У меня два события: 1st Вы щелкаете изображение, которое оно перемещает и расширяется 2nd вы щелкаете за пределами изображения, и оно перемещается и сжимается обратно в его организацию. должность.Нечетное поведение анимации 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 –
Получил +1 от Woz? :) – YD1m