又得开始新的工作累人啊。
类似QQ管家页面jquery图片显隐轮换效果
原创
©著作权归作者所有:来自51CTO博客作者jqueryba的原创作品,请联系作者获取转载授权,否则将追究法律责任
这两天jquery博客有不少感慨,感觉人有时要是言而无信,那不管做什么事情都不会成功的,觉得,既然说出口了,或者,暗暗下决心做了,就一定做成功。如果不行,那是自己的责任。不多说了,做个类似QQ管家页面jquery图片显隐轮换效果,感觉在哪个页面中看到过,反正是腾讯的,故加个类似。http://www.jqueryba.com/475.html
$(document).ready(function() {
var z = 0;
var inAnimation = false;
$('#box img').each(function() {
z++;
$(this).css('z-index', z);
});
function slide() {
if(inAnimation) return false;
else inAnimation = true;
var MaxZindex = z; SecondZindex = z-1;
$('#box img').each(function() {
if($(this).css('z-index') == MaxZindex) {
$(this).animate({left:"350px"}, 800, function() {
$(this).css('z-index', 1)
.animate({left:"0px"}, 800, function() {
inAnimation = false;
});
});
} else if($(this).css('z-index') == SecondZindex) {
$(this).animate({left:"-80px"}, 800, function() {
$(this).css('z-index', parseInt($(this).css('z-index')) + 1);
}).animate({left:"0px"}, 800);
}else{
$(this).animate({left:"0px"}, 600, function() {
$(this).css('z-index', parseInt($(this).css('z-index')) + 1);
});
}
});
return false;
}
$('#box').click(function() {
slide();
});
});
在线效果DEMO
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
JS实现简单的图片轮换效果
简单的图片轮换js实现
JS 图片轮换 -
图片轮换
代码一个图片效果。忘了。
ide ico html c++ 取值
















