我有兩個事件正在進行 1st你點擊一個圖像它移動並展開 第二次點擊圖像外部,它移動並縮回到它的組織。位置。奇怪的jQuery動畫行爲
當你點擊你必須等待像30秒的動畫火災外區(萎縮)
$(document).ready(function() {
var titles=new Array("1","2","3", "4","5", "6", "7", "8","9");
var image=0;
var p;
$('.grid li').click(function() {
var location =$(this).index();
image = $(this).position();
$(this).siblings().animate({opacity: 1, top:'15px'},800,function() {
$(this).siblings().css("top", "0px");
p =$(this).parent().detach();
$('.pop_image img ').css("left", image.left);
$('.pop_image img').css("top", image.top);
$('.pop_title ').css("left", image.left);
$('.pop_title').css("top", image.top-50);
$('.pop_image img').animate({marginLeft: '20%',marginRight: '20%', marginTop: '20%', top: '0', left: '0'},800);
$('.pop_image img').attr("src", location+1 +".jpg");
$('.pop_title').animate({marginLeft: '20%',marginRight: '20%', marginTop: '20%', top: '-50px', left: '0'},800);
$('.pop_title ').text(titles[location]);
$('.pop_title').animate({fontSize: '200%'},800);
$('.pop_image img').animate({width:'679px', height:'422px'},800);
});
});
$('#hidden').click(function() {
$('.pop_title').animate({fontSize: '100%'},800);
$('.pop_image img').animate({width:'339px', height:'211px'},800);
$('.pop_image img').animate({left: image.left, right: image.top },800);
$('.pop_title').animate({left: image.left, right: image.top },800);
});
});
你能爲我們創建一個jsFiddle或類似的測試嗎? –
新增了jsfiddle –
Woz獲得+1了嗎? :) – YD1m