使用jquery爆炸动画

cod*_*der 3 jquery animation image explode

我有一个带有span标签的容器,如果我单击span元素,我需要有一个爆炸动画,并删除该元素.

我能够使用淡入淡出效果,但我不知道如何使用爆炸效果,如果使用这种方式它只是删除没有任何动画:

CSS:

#container a span { display:none; background-image:url(images/remove.png); background-repeat:no-repeat; width:16px; height:16px; position:absolute; right:0px; top:0px;} 
#container a:hover span { display:block;}  
Run Code Online (Sandbox Code Playgroud)

淡化效果:

  $('.container a span').live('click', function (e) {
                $(this).closest('div.container').fadeOut("normal", function () {
                  $(this).remove();
                                });
                return false;
   });
Run Code Online (Sandbox Code Playgroud)

爆炸效应

$('.container a span').live('click', function (e) {
                    $(this).closest('div.container').fadeOut("normal", function () {
                    $(this).hide('explode', { pieces: 25 }, 600);
                      $(this).remove();
                                    });
                    return false;
});
Run Code Online (Sandbox Code Playgroud)

这些是我绑定动态添加的图像,如下所示:

 uploader.bind('FileUploaded', function (up, file, res) {
            $('#container').append("<div class='container a'><a href='#'><img src='uploads/" + document.getElementById("currentDirectory").value + "/" + file.name + "' width='64' height='64'/><span></span></a></div>");

            $('.container a span').live('click', function (e) {
                $(this).closest('div.container').fadeOut("normal", function () {
                    $(this).remove();
                });
                return false;
            });
});
Run Code Online (Sandbox Code Playgroud)

这是我展示图片的地方:

 <div id="container">

  </div>
Run Code Online (Sandbox Code Playgroud)

Jef*_*cel 5

我想这就是你想要的?

$('.container a span').live('click', function (e) {
    $(this).hide('explode', { "pieces":25 }, 600, function() { $(this).remove; });
    return false;
});
Run Code Online (Sandbox Code Playgroud)