| | |
dispatching an event using setTimeout
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Apr 2007
Posts: 25
Reputation:
Solved Threads: 0
Hello everyone, I've ran into something that's been confusing me. Here's my code snippet:
What happens in Firefox is when the
Thank you,
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
if (parent.scrollTop < parent.scrollHeight) { if(document.fireEvent){ //IE setTimeout("document.fireEvent('onmousemove')", 10); }else{ //FF var changeEvent = document.createEvent("MouseEvents") changeEvent.initEvent("mousemove", true, true); setTimeout("document.dispatchEvent(changeEvent)", 10); } }
setTimeout fires, it tells me that changeEvent is undefined. To me, it seems to be defined. Has anyone run into this before and know how to work around it?Thank you,
Last edited by jmasta; Jan 6th, 2009 at 1:13 pm.
•
•
Join Date: Apr 2007
Posts: 25
Reputation:
Solved Threads: 0
After doing some googling, I found this thread:
http://www.daniweb.com/forums/thread102251.html
which was very similar to mine. I tried ~s.o.s~'s suggestion and it worked very well, and I learned a little bit more about setTimeout. Thank you!
http://www.daniweb.com/forums/thread102251.html
which was very similar to mine. I tried ~s.o.s~'s suggestion and it worked very well, and I learned a little bit more about setTimeout. Thank you!
![]() |
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Function to find prime numbers
- Next Thread: Tutorial On Creating Powerful Layouts
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxjspservlets array browser bug captchaformproblem cart checkbox child class close codes cookies createrange() css cursor date debugger decimal dependent design disablefirebug dom dropdown editor element embed engine enter events explorer ext file firefox focus form forms frameworks getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe images index internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl listbox maps masterpage math media menu mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php position post programming progressbar prototype redirect runtime safari scale scriptlets scroll search security session shopping size software toggle unicode variables web wysiwyg \n





