0
我有以下的jQuery代碼:jquery的縮放效果很慢?
$(document).ready(function() {
$('.box').click(function(){
var selectedBox = $(this),
selectedBoxLocationX = selectedBox.offset().left,
selectedBoxLocationY = selectedBox.offset().top;
selectedBox.animate({left:-selectedBoxLocationX, top:-selectedBoxLocationY},600).addClass('current');
otherBoxes = $('.box:not(.current)');
otherBoxes.animate({left:2000},600);
selectedBox.effect('scale', {percent:500, direction: 'vertical'}, 1000);
selectedBox.click(function(){
selectedBox.effect('scale', {percent:20, direction: 'vertical'},200);
otherBoxes.animate({left:0},600);
selectedBox.animate({top: 0, left: 0},700).removeClass('current');
});
});
});
我發現了selectedBox規模的20%是在踢很慢它實際上是擴展的selectedBox動畫後。
誰能告訴我爲什麼會發生這種情況?
MTIA!
你能提供jsfiddle的例子嗎? – Niklas
謝謝Niklas - http://jsfiddle.net/sk62Y/ – circey