sajan Posted March 18, 2008 Share Posted March 18, 2008 Hi How can we pass mouse events through a dynamically generated elements function?eg newdiv.onmousedown = function(){fn_name(divname,event);} when i pass the event i get undefined.What may be the reason? Link to comment Share on other sites More sharing options...
jeffman Posted March 18, 2008 Share Posted March 18, 2008 Try this. newdiv.onmousedown = function(event){fn_name(divname,event||window.event);} Link to comment Share on other sites More sharing options...
jhecht Posted March 18, 2008 Share Posted March 18, 2008 or, since the function is being called from a pre-set onmousedown event, you could just pass 'mousedown' as a string to the function. Link to comment Share on other sites More sharing options...
sajan Posted March 18, 2008 Author Share Posted March 18, 2008 Vow vow thats great .its working. many thanks Deirdre's Dad .u saved my day.Also i like to know the difference between pageY and clientY.i got [pageY 834 and the same clientY is 314. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.