欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

嵊泗花鸟岛图片切换【走光效果】

发布时间:2024/1/18 编程问答 112 豆豆
生活随笔 收集整理的这篇文章主要介绍了 嵊泗花鸟岛图片切换【走光效果】 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
<!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8"><title>图片渐渐切换</title><style>#left_screen{width:189px;height: 329px;overflow: hidden;top:86px;left:47px;z-index: 1;position: absolute;}#left_screen img{width:189px;height: 329px;top:0;left:0;z-index: 2;position: absolute;display:none;}</style> </head> <body><div id="left_screen"><img src="images/slider1.png" /><img src="images/slider2.png" /><img src="images/slider3.png" /><img src="images/slider1.png" /><img src="images/slider1.png" /><img src="images/slider2.png" /><img src="images/slider3.png" /><img src="images/slider1.png" /></div><script type="text/javascript" src="../js/jquery.min.js"></script><script type="text/javascript">function wordsShow(ele){var i=-1;var len=ele.children("img").length;function wordsAnimate(){ //设置走光动画 i++;if(i<len){ setTimeout(function(){ele.children("img").eq(i).show().siblings().hide();wordsAnimate(); //内部回调 },200);}}wordsAnimate(); //执行一次动画,否则其他动画不隐藏 }wordsShow($("#left_screen"));//立刻执行一次 setInterval(function(){wordsShow($("#left_screen"))},2000);/*循环执行*/</script> </body> </html>

 

 

<!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8"><title>图片渐渐切换</title><style>#left_screen{width:189px;height: 329px;overflow: hidden;top:86px;left:47px;z-index: 1;position: absolute;}#left_screen img{width:189px;height: 329px;top:0;left:0;z-index: 2;position: absolute;display:none;}</style> </head> <body><div id="left_screen"><img src="images/slider1.png" /><img src="images/slider2.png" /><img src="images/slider3.png" /><img src="images/slider1.png" /><img src="images/slider1.png" /><img src="images/slider2.png" /><img src="images/slider3.png" /><img src="images/slider1.png" /></div><script type="text/javascript" src="../js/jquery.min.js"></script><script type="text/javascript">function imgShow(ele){var i=-1;var len=ele.children("img").length;function imgAnimate(){ //设置走光动画 i++;if(i<len){ setTimeout(function(){ele.children("img").eq(i).show().siblings().hide();imgAnimate(); //内部回调 },200);}}imgAnimate(); //执行一次动画,否则其他动画不隐藏 }imgShow($("#left_screen"));//立刻执行一次 setInterval(function(){imgShow($("#left_screen"))},2000);/*循环执行*/</script> </body> </html>

 

转载于:https://www.cnblogs.com/shimily/articles/4612436.html

总结

以上是生活随笔为你收集整理的嵊泗花鸟岛图片切换【走光效果】的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。