您好,欢迎访问一九零五行业门户网

js图片轮播手动切换效果实例代码

这篇文章主要为大家详细介绍了js图片轮播手动切换效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
利用scrollpicleft.js这个库实现图片的前后切换,适用于网页中的证书展示、推荐商品之类的栏目。它不像传统的marquee滚动那样,而是可以手动的去点击前后切换箭头按钮,进行图片的翻页,从而达到浏览上一张,下一张的效果。
不需要调用jquery,初始化简单,使用非常的简单,便利。
实例效果:
js代码:
<script type="text/javascript"> var scrollphoto = new scrollpicleft(); scrollphoto.scrollcontid = "isl_photo"; // 内容容器id"" scrollphoto.arrleftid = "left_photo";//左箭头id scrollphoto.arrrightid = "right_photo"; //右箭头id scrollphoto.framewidth = 450;//显示框宽度 scrollphoto.pagewidth = 150; //翻页宽度 scrollphoto.speed = 10; //移动速度(单位毫秒,越小越快) scrollphoto.space = 10; //每次移动像素(单位px,越大越快) scrollphoto.autoplay = false; //自动播放 scrollphoto.autoplaytime = 3; //自动播放间隔时间(秒) scrollphoto.initialize(); //初始化 </script>
本文实例讲述了js图片轮播手动切换效果。分享给大家供大家参考。具体如下:
这是一款基于js图片轮播手动切换效果代码,实现过程很简单。
为大家分享的js图片轮播手动切换效果代码如下
<head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>js图片轮播手动切换效果</title> <script type="text/javascript" src="js/scrollpicleft.js"></script> <style> html,body,ul,li{margin:0; padding:0;} ul,li{ list-style:none;} .dd_main{ width:520px;} .zl_left { width:35px; float:left; text-align:left; padding-top:60px} .zl_right { width:35px; float:right; text-align:right; padding-top:60px} .zl_content { width:450px; height:153px; float:left; overflow:hidden;} .zl_content ul li { width:130px; padding:0 10px; text-align:center; float:left;} .welcome{ position:fixed; width:100%; text-align:center; bottom:30px;} .welcome a{ color:#0350b8;} </style> </head> <body> <p class="dd_main"> <p class="zl_left" id="left_photo"><a href="javascript:void(0)"><img src="images/zl_tb1.jpg" width="24" height="32" /></a></p> <p class="zl_content"> <ul id="isl_photo"> <li><img src="images/zl_tp.jpg" width="130" height="153" /></li> <li><img src="images/zl_tp.jpg" width="130" height="153" /></li> <li><img src="images/zl_tp.jpg" width="130" height="153" /></li> <li><img src="images/zl_tp.jpg" width="130" height="153" /></li> <li><img src="images/zl_tp.jpg" width="130" height="153" /></li> <li><img src="images/zl_tp.jpg" width="130" height="153" /></li> <li><img src="images/zl_tp.jpg" width="130" height="153" /></li> </ul> </p> <p class="zl_right" id="right_photo"><a href="javascript:void(0)"><img src="images/zl_tb2.jpg" width="24" height="32" /></a></p> </p> <script type="text/javascript"> var scrollphoto = new scrollpicleft(); scrollphoto.scrollcontid = "isl_photo"; // 内容容器id"" scrollphoto.arrleftid = "left_photo";//左箭头id scrollphoto.arrrightid = "right_photo"; //右箭头id scrollphoto.framewidth = 450;//显示框宽度 scrollphoto.pagewidth = 150; //翻页宽度 scrollphoto.speed = 10; //移动速度(单位毫秒,越小越快) scrollphoto.space = 10; //每次移动像素(单位px,越大越快) scrollphoto.autoplay = false; //自动播放 scrollphoto.autoplaytime = 3; //自动播放间隔时间(秒) scrollphoto.initialize(); //初始化 </script> </body> </html>
以上就是js图片轮播手动切换效果实例代码的详细内容。
其它类似信息

推荐信息