I am working on this JS Bin and everything works okay except I want to make this pop-up menu (appears after 1 sec from hovering) stay in until mouseout
so user(s) can hover on the list.
How do I do that?
Try
$(function() {
var $popup = $('.popup');
$popup.hover(function() {
clearTimeout($popup.data('outTimeout'))
}, function() {
$(this).finish().fadeOut();
})
$('.input-block-level').hover(function() {
var target = $(this).attr('id');
clearTimeout($popup.data('outTimeout'))
var timeout = setTimeout(function() {
$popup.fadeIn().insertAfter('#' + target);
}, 1000);
$popup.data('inTimeout', timeout)
}, function() {
clearTimeout($popup.data('inTimeout'))
var timeout = setTimeout(function() {
$popup.stop(true).fadeOut();
}, 300);
$popup.data('outTimeout', timeout)
});
}(jQuery));
Demo: JSBIN
尝试这个,
$("Id").hover(function(){$("#popId").fadeOut(1000);$("#popId").fadeIn(500);});