0

属性によって配置されている .thumb 兄弟要素 .description をホバリングするときに、mouseleave トリガーの起動を停止するにはどうすればよいですか: position absolute.

次のjsコードがあります

$('.thumb').on({
    mouseenter: function() {
        $(this).siblings('.description').delay(100).slideDown(200);
        start_preview($(this));
    },

    mouseleave: function(e) {
        $(this).siblings('.description').stop(true, true).slideUp(200);
        clearInterval( $(this).data('timer') ); //Stops preview
    }
});

次の HTML コードの場合:

<td><a href="/video?id=1052">
    <img class="thumb" src="path" />
    <div class="description"></div>
</a></td>   
4

2 に答える 2

1
$('.thumb').on({
    mouseenter: function() {
        $(this).siblings('.description').delay(100).slideDown(200);
        start_preview($(this));
    },

    mouseleave: function(e) {
        var sibs = $(this).siblings('.description');
        $.each(sibs, function(i, v) {
            if ($(this).css('position') == 'absolute') {
                return false;
            } else {
                $(this).stop(true, true).slideUp(200);
                clearInterval( $(this).data('timer') ); //Stops preview
            };
        });
    }
});
于 2013-07-09T16:03:29.850 に答える