-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)
我有什么改变?谢谢!