实现图片滚动
来源:互联网 发布:java培训出来的工资 编辑:程序博客网 时间:2024/05/22 11:43
简要截图:
简要代码:
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>滚动图片效果展示</title> <script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.js"></script> <script src="http://cdn.bootcss.com/velocity/1.2.3/velocity.js"></script> <style type="text/css"> div:not(:last-of-type){ width:80%;height:750px;margin:0 auto; } div:first-of-type{background:url(imgs/1.jpg);background-size:cover;} div:nth-of-type(2){background:url(imgs/2.jpg);background-size:cover;} div:nth-of-type(3){background:url(imgs/3.jpg);background-size:cover;} div:nth-of-type(4){background:url(imgs/4.jpg);background-size:cover;} div:nth-of-type(5){background:url(imgs/5.jpg);background-size:cover;} div:nth-of-type(6){background:url(imgs/6.jpg);background-size:cover;} div:nth-of-type(7){background:url(imgs/7.jpg);background-size:cover;} div:last-of-type{position:fixed;top:130px;right:50px;} div:last-of-type ul{list-style:none;} div:last-of-type ul li{width:30px;height:30px;background:black;margin:3px;color:white;text-align:center;line-height:30px;} div:last-of-type ul li:hover {cursor:pointer; } </style></head><body> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div> <ul><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li></ul> </div></body></html><script type="text/javascript"> $("div:last ul li").click(function () { var numLi = $(this).text(); $("div:last ul li").css({ "background-color": "black", "color": "white" });//每次都对所有的li背景色进行初始化,点击哪个改变哪个li的背景颜色和字体颜色 switch (numLi) { case "1": $("div:first").velocity("scroll", { duration: 300 }); $(this).css({"background-color":"white","color":"black"});break; case "2": $("div:eq(1)").velocity("scroll", { duration: 300 }); $(this).css({ "background-color": "white", "color": "black" }); break; case "3": $("div:eq(2)").velocity("scroll", { duration: 300 }); $(this).css({ "background-color": "white", "color": "black" }); break; case "4": $("div:eq(3)").velocity("scroll", { duration: 300 }); $(this).css({ "background-color": "white", "color": "black" }); break; case "5": $("div:eq(4)").velocity("scroll", { duration: 300 }); $(this).css({ "background-color": "white", "color": "black" }); break; case "6": $("div:eq(5)").velocity("scroll", { duration: 300 }); $(this).css({ "background-color": "white", "color": "black" }); break; case "7": $("div:eq(6)").velocity("scroll", { duration: 300 }); $(this).css({ "background-color": "white", "color": "black" }); break; } }); </script>
0 0
- javascript实现滚动图片
- javascript 实现图片滚动
- 图片滚动js实现
- js实现图片滚动
- javascript实现滚动图片
- javascript实现滚动图片
- 一张图片实现滚动
- javascript实现图片滚动
- js 图片滚动实现
- 图片实现无缝滚动
- js实现图片滚动
- javaScript实现图片滚动
- Android 实现滚动图片
- 实现图片滚动
- 实现图片滚动浏览代码滚动源代码
- javascript实现图片滚动效果
- 怎么实现图片的滚动
- JS实现图片无缝滚动
- 附加进程的作用→_→
- Jquery-EasyUI学习~
- Java 面向对象
- 浅谈Instan Run中的热替换
- 图片添加水印
- 实现图片滚动
- 数组求交集排序
- SqlServer——全文索引
- 页面静态化实现——根据模板动态创建静态页
- 图片上传和显示——上传图片——上传文件)==ZJ
- 清空KindEditor富文本编辑器里面的内容方法
- MVC中使用Ajax提交数据 Jquery Ajax方法传值到action
- 11G RAC 一节点宕机后修改监听相关配置使通过宕机节点VIP连接数据库的客户端可以连接
- 牛逼的OSQL----大数据导入