By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,259 Members | 1,708 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,259 IT Pros & Developers. It's quick & easy.

how can i make timed onmouseover event close if mouse if not over

P: 14
Ok I have these divs but i need to make them close if the mouse is not over i have the onmouseout event but im using the below timeout script

onmouseover=\"timer1=setTimeout(function(){documen t.getElementById('viewcommenter.$commentid').style .display = 'block';}, 1750);\"

so the issue is if you hove over this it will pop up 1750ms later and if your mouse isnt over the element still the onmouseout event is never triggered so its leaving the divs open

any ideas on how to make it recheck after the 1750ms to make sure the mouse is still over?

thanks
Aug 6 '11 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,430
In the on mouse over, set a global variable to true. On mouse out, set it to false. In the timer function, check the global variable before running the rest of the function.
Aug 7 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.