How do I trigger this inline function
onClick="showMenu('mnu_searches', event, 0, this)
using JQuery…if I hover over a.menu-arrow ? I need to trigger a click after the user has been hovering over the element for 2 seconds?
Any help would be greatly appreciated, Thanks
You can create and clear a 2 second timer, like this:
You can give it a try here. By using
$.data()we’re storing a timeout per element to avoid any issues and clear the correct timer. The rest is just setting a 2 second timer when entering the element, and clearing it when leaving. So if you stay for 2000ms, it fires a.click(), if you leave it stops clear the timer.