Hello everyone, I've ran into something that's been confusing me. Here's my code snippet:

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);
		 }
	}

What happens in Firefox is when the 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,

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.