当前位置:Gxlcms > JavaScript > 一个实用的图片切换支持点击切换和自动轮播_jquery

一个实用的图片切换支持点击切换和自动轮播_jquery

时间:2021-07-01 10:21:17 帮助过:8人阅读

不经意间看到了以前写的这个小东西,就贴上来了,支持点击切换和自动轮播,供前端新手看看吧!

代码如下:

  • 项目一
  • 项目二
  • 项目三
  • 项目四
  • 项目五

html

此处只需将图片路径改成你本地的即可。

.scroll_div{width:1000px; height:370px; margin:0 auto; padding:10px;}
.scroll_div .pic{width:820px; height:370px; overflow:hidden; position:relative; float:left;}
.scroll_div .pic li{width:820px; height:370px; position:absolute; top:0; left:0; display:none;}
.scroll_div .btn{float:right; width:173px;}
.scroll_div .btn li{width:173px; height:66px; display:block; float:left; text-align:center; color:#fff; font:18px/100% "微软雅黑"; font-weight:bold; background:#008dd8; margin-bottom:10px; line-height:66px; cursor:pointer;}
.scroll_div .btn li.on{background:#d73737;}

li {list-style:none;}

css

人气教程排行