You were on the right track with setTimeout:
jQuery('selector').mouseenter(function() {
var $elm = jQuery(this);
setTimeout(function() {
$elm.click()
}, 500);
});
Please note that this will trigger a click even if the mouse leaves the element in this half second. If you want to cancel the click, if the mouse leaves the element, you must remember the timer handle and cancel:
jQuery('selector')
.mouseenter(function() {
var $elm = jQuery(this),
timer = $elm.data("timer");
if (timer) {
clearTimeout(timer);
}
$elm.data("timer", setTimeout(function() {
$elm.click()
}, 500));
})
.mouseleave(function() {
var $elm = jQuery(this),
timer = $elm.data("timer");
if (timer) {
clearTimeout(timer);
$elm.removeData("timer");
}
})
;
data, , , , . , , (, , ), , clearTimeout .