$(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);
});
})
XHTMT|
HTML5|
CSS|
HTML DOM|
jQuery|
JSON|
AJAX|
LESS|
HTML|
Bootstrap|
Foundation|
AngularJS|
Ember.js|
TypeScript|
AngularJS2|
React|
jQuery UI|
jQuery EasyUI|
Node.js|
Highcharts|
Echarts|
Vue.js|
CoffeeScript|
Ext.js|
Meteor|
SASS|
Omi|
Markdown|
前端开发规范|
浏览器|
webpack|
JavaScript|
CSS3|
用户登录
还没有账号?立即注册
用户注册
投稿取消
| 文章分类: |
|
还能输入300字
上传中....
我的jj比我名字长八倍