PDA

View Full Version : onsomeevent - how to add function


looka
06-20-2005, 06:57 AM
hi, im tryin to add function to an onmouseevent - what im i doing wrong...


function sth(){body}
sth.prototype.a=new Array();


than, in another function i would like to append this function to onmousemove event


function sthelse(){
d=document.getElementById('mydiv');
d.onmousemove= new sth;
}


it also doesnt works if i call

d.onmousemove=sth
or
d.onmousemove=sth()


should i create that function on the fly -

d.onmousemove=function(){body};
d.onmousemove.prototype.a=new Array();