-1

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?

4

2 回答 2

1

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

于 2013-08-07T03:46:11.173 回答
0

尝试这个,

$("Id").hover(function(){$("#popId").fadeOut(1000);$("#popId").fadeIn(500);});

于 2013-08-07T02:13:34.923 回答