JS实现花瓣网轮播图效果(未测试)
来源:互联网 发布:电脑监控软件有哪些 编辑:程序博客网 时间:2024/04/29 05:41
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN""> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>index</title> <style> body{ background:#57beb9; } #main{ width:920px; /*border: 1px solid red;*/ height:430px; overflow:hidden; position:relative; margin:30px auto; } #main .box{ width:820px; height:430px; box-shadow:0px 0px 5px #ddd; margin:0px auto; overflow:hidden; /*border: 2px solid blue;*/ position:relative; } #main .box img{ width:820px; height:430px; position:absolute; left:0px; top:0px; opacity:0; filter:alpha(opacity=0); } #main .btnLeft{ width:35px; height:57px; position:absolute; left:0px; top:185px; /*border: 1px solid yellow;*/ background:url(./images/left_ar.png) no-repeat 0px 0px; } #main .btnRight{ width:35px; height:57px; position:absolute; right:0px; top:185px; /* border: 1px solid yellow;*/ background:url(./images/right_ar.png) no-repeat 0px 0px; } #main .page{ width:132px; height:22px; position:absolute; bottom:15px; right:50px; } #main .page a{ display:inline-block; width:22px; height:22px; background:url(./images/num_grey.png) no-repeat 0px 0px; margin:0px 11px; float:left; color:#FFF; text-decoration:none; text-align:center; } #main .page a.active{ background:url(./images/num_red.png) no-repeat 0px 0px; } </style> <script src="jquery.js"></script> <script> $(function(){ var apage=$('#main .page a'); var aimg=$('#main .box img'); var index=0; var asize=aimg.size(); $('#btnLeft').click(function(){ index--; if(index<0){ index=asize-1; document.title=index; } change(); }) $('#btnRight').click(function(){ index++; if(index>asize-1){ index=0; document.title=index; } change(); }) apage.click(function(){ index=$(this).index(); change(); }); function change(){ apage.removeClass('active'); apage.eq(index).addClass('active'); aimg.eq(index).siblings().stop().animate({ opacity: 0 },300) aimg.eq(index).stop().animate({ opacity: 1 },300) } }) </script> </head> <body> <div id="main"> <a class='btnLeft' id="btnLeft" href="javascript:void(0);"> </a> <a class='btnRight' id="btnRight" href="javascript:void(0);"> </a> <div class="box"> <img style="opacity:1;filter:alpha(opacity=100);" src="./images/intro1.jpg"/> <img src="./images/intro2.jpg"/> <img src="./images/intro3.jpg"/> </div> <div class='page'> <a class='active' href="javascript:void(0);">1</a> <a href="javascript:void(0);">2</a> <a href="javascript:void(0);">3</a> </div> </div> </body> </html>
0 0
- JS实现花瓣网轮播图效果(未测试)
- 花瓣网轮播图效果
- 花瓣网轮播图效果
- jQuery实现的进度条效果(未测试)
- JS实现无刷新倒计时(未测试)
- 页面花瓣效果
- d3.js画矢量图+可拖拽的实现思路(未测试)
- CSS3和jQuery实现花瓣网固定顶部位置悬浮菜单效果
- js 倒计时功能 (未测试)
- js合并单元格(未测试)
- Android实现振动效果_全屏_无标题_横屏【未测试】
- 选项卡js 改变图片的路径来实现点击和未点击的不同效果
- EulerAngles-未测试-实现文件
- Quaternion-未测试-实现文件
- RotationMatrix-未测试-实现文件
- Matrix4x3-未测试-实现文件
- jQuery 实现 点击按钮后倒计时效果,多用于实现发送手机验证码、邮箱验证码(未测试)
- JS实现保存当前网页HTML到本地(Chrom Firefox)(未测试)
- JS实现保存当前网页HTML到本地(Chrom Firefox)(未测试)
- DOG简析
- 欢迎使用CSDN-markdown编辑器
- Python自定义豆瓣电影种类,排行,点评的爬取与存储(进阶上)
- freeradius 限制rp-pppoe服务器每一个连接的带宽
- JS实现花瓣网轮播图效果(未测试)
- unity_VR gallery小画廊实现
- git常用命令整理
- java中length,length(),size()区别
- POJ2318 TOYS, POJ2398 Toy Storage
- 每日一linux命令(36)-------free 命令
- 配置freeradius各种限制的配置方法
- JS this关键字详解
- Spark算子:RDD行动Action操作(5)–saveAsTextFile、saveAsSequenceFile、saveAsObjectFile