如何创造更好的爆炸效果

Mat*_*teo 2 jquery animation jquery-ui

我有一个我想要完成的动画应该类似于从下面出现的气泡,然后点击,爆炸显示文本.

这段代码产生了当前的影响:

jQuery('.bubble1').on('click', function () {
 jQuery(this).stop(true,true).hide('explode', { pieces: 75 } , 1000, function() {
  jQuery('.corpo-del-testo').show();
 });
});
Run Code Online (Sandbox Code Playgroud)

我也做了一个jsFiddle来证明这个效果.

我想有一个更好的爆发效果,但我无法找到解决方案,任何人有类似的问题或知道如何实现像更真实的爆炸泡沫?像一阵爆发.

提前致谢.

goo*_*rse 10

这是我创建的另一种气泡弹出效果.

http://jsfiddle.net/EkZBg

<div id="content">
  <div id="bubble"></div>
  <div id="dummy_debris" class="debris" />
</div>

<script>

$(function(){
  // Document is ready
  $("#bubble").on("click", function(e) {
    pop(e.pageX, e.pageY, 13);
  });
});

function r2d(x) {
    return x / (Math.PI / 180);
  }

  function d2r(x) {
    return x * (Math.PI / 180);
  }

  // Specify particle_count as 10 + Math.random()*10 to make things interesting!
  function pop(start_x, start_y, particle_count) {
    arr = [];
    angle = 0;
    particles = [];
    offset_x = $("#dummy_debris").width() / 2;
    offset_y = $("#dummy_debris").height() / 2;

    for (i = 0; i < particle_count; i++) {
      rad = d2r(angle);
      x = Math.cos(rad)*(80+Math.random()*20);
      y = Math.sin(rad)*(80+Math.random()*20);
      arr.push([start_x + x, start_y + y]);
      // You could use an IMG tag here instead to make the particles sprites
      z = $('<div class="debris" />');
      z.css({
        "left": start_x - offset_x,
        "top": start_y - offset_x
      }).appendTo($("#content"));
      particles.push(z);
      angle += 360/particle_count;
    }

    $.each(particles, function(i, v){
      $(v).show();
      $(v).animate({
        top: arr[i][1], 
        left: arr[i][0],
        width: 4, 
        height: 4, 
        opacity: 0
      }, 600, function(){
        $(v).remove()
      });
    });
  }
</script>

<style>
/* Add browser prefixes as-needed. See CSS3please.com */
.debris {
 display: none;   
 position: absolute;
 width: 28px;
 height: 28px;
 background-color: #ff00ff;
 opacity: 1.0;
 overflow: hidden;
 border-radius: 8px;
}

#bubble {
  position:absolute;
  background-color: #ff0000;
  left:150px;
  top:150px;
  width:32px;
  height:32px;
  border-radius: 8px;
  z-index: 9;
}
</style>
Run Code Online (Sandbox Code Playgroud)