类似QQ管家页面jquery图片显隐轮换效果

原文引用http://www.oschina.net/code/snippet_268286_11424

 

01

$(document).ready(function() {

02 var z = 0;
03 var inAnimation = false;
04 $('#box img').each(function() {
05z++;
06 $(this).css('z-index', z);
07});
08 function slide() {
09 if(inAnimation) return false;
10 else inAnimation = true;
11 var MaxZindex = z; SecondZindex = z-1;
12 $('#box img').each(function() {
13 if($(this).css('z-index') == MaxZindex) {
14 $(this).animate({left:"350px"}, 800, function() {
15 $(this).css('z-index', 1)
16 .animate({left:"0px"}, 800, function() {
17 inAnimation = false;
18});
19});
20 else if($(this).css('z-index') == SecondZindex) {
21 $(this).animate({left:"-80px"}, 800, function() {
22 $(this).css('z-index', parseInt($(this).css('z-index')) + 1);
23 }).animate({left:"0px"}, 800);
24 }else{
25 $(this).animate({left:"0px"}, 600, function() {
26 $(this).css('z-index', parseInt($(this).css('z-index')) + 1);
27});
28}
29});
30 return false;
31}
32 $('#box').click(function() {
33slide();
34});
35});
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值