清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
$(function(){
$('.item').each(function(){
var size = $('.item').size();
var index = $('.item').index($(this));
$(this).css({
left:index * 160,
top:50 - Math.abs(index - Math.floor(size/2))*50,
zIndex:size - Math.abs(index - Math.floor(size/2))
});
$(this).attr('index',index);
});
$('.item').click(function(){
var current = $('.item[current]');
current.stop(true,true);
$(this).stop(true,true);
var top = current.css('top');
var left = current.css('left');
var index = current.attr('index');
$('.item[current]').css('zIndex',$(this).css('zIndex')).removeAttr('current');
current.attr('index',$(this).attr('index'));
current.animate({top:$(this).css('top'),left:$(this).css('left')},500);
$(this).css('zIndex',999);
$(this).attr('current','');
$(this).animate({top:top,left:left},500);
});
})