2015-02-23 92 views
-1

I found a jsfiddle with a working pulsating circle (jQuery 1.8.5 edge)創建一個脈動圈

我的代碼非常相似。

function addCircle() { 
     //var rad = $(window).width(); 
     var $circle = $('<div class="circle"></div>'); 
     $circle.animate({ 
      'width': '300px', 
      'height': '300px', 
      'margin-top': '-150px', 
      'margin-left': '-150px', 
      'opacity': '0' 
     }, 4000, 'easeOutCirc'); 
     $('body').append($circle); 

     setTimeout(function __remove() { 
      $circle.remove(); 
     }, 4000); 
    } 
    addCircle(); 
    setInterval(addCircle, 1200); 

它不使用jQuery 1.11.x 控制檯錯誤的工作很簡單:

jquery.min.js:4 Uncaught TypeError: undefined is not a function

The same jsfiddle with the latest jquery (1.11.0)

我有什麼改變?謝謝!

回答