【问题标题】:Jquery animation 'hover' lost to delete itemJquery 动画“悬停”丢失删除项目
【发布时间】:2012-10-15 00:00:12
【问题描述】:

我正在尝试从列表中删除一个项目而不丢失动画“悬停”: jsfiddle

代码

$(window).load(function() {

    $('.parent').hover(function() {

        $('.child').css({
            "width": "320px",
            "height": "300px"
        });
        $(this).find('.child').dequeue().stop().slideToggle("fast");

    });

    $(".binda").click(function() {
        $(this).remove()
    });

});​

【问题讨论】:

  • 但是,删除项目后没有。

标签: jquery jquery-animate css-animations


【解决方案1】:

试试这个demo http://jsfiddle.net/pYa87/

API:

希望它符合原因:)

代码

$(window).load(function() {

    $('.parent').mouseover(function() {

        $('.child').css({
            "width": "320px",
            "height": "300px"
        });
        $(this).find('.child').dequeue().stop().slideDown("fast");

    }).mouseout(function() {

        $(this).find('.child').dequeue().stop().slideUp("fast");
    });

    $(".binda").click(function() {
        $(this).remove()
    });

});​

【讨论】:

    【解决方案2】:

    您的方法是有道理的,但不幸的是行不通。我修复了小提琴并根据我认为您正在尝试做的事情来实现您可以做的事情。

    $(window).load(function() {
    
        $('.parent').hover(function() {
            $('.child').stop().slideDown('fast');
        }, function() {
            $('.child').stop().slideUp('fast');
        });
    
        $('.binda').click(function() {
            $(this).remove();
        });
    
    });​
    

    Fiddle

    【讨论】:

      猜你喜欢
      • 2010-11-06
      • 2011-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多