<!DOCTYPE html> <html> <head> <title></title> <style> .out_pic{ width: 320px; height: 220px; position: relative; background: #ffffff; border: 1px #dddddd solid; padding: 5px; overflow: hidden; } .inner_pic{ position: absolute; left: 0; top: 0; list-style: none; margin: 5px; padding: 0; width: 975px; } .inner_pic li{ list-style: none; padding: 0; float: left; margin-right: 5px; } .inner_pic li img{ width: 320px; height: 220px; } .pic_control { position: absolute; top: 40%; cursor: pointer; width: 40px; height: 40px; margin-top: -20px; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 60px; font-weight: 100; line-height: 30px; color: #fff; text-align: center; background: #222; border: 3px solid #fff; -webkit-border-radius: 23px; -moz-border-radius: 23px; border-radius: 23px; opacity: .5; filter: alpha(opacity=50); } .pic_control:hover{ opacity: .7; filter: alpha(opacity=70); } .pic_prev{ left: 15px; } .pic_next{ right: 15px; left: auto; } </style> <script src="http://code.jquery.com/jquery-1.8.3.min.js"> </script> <script> $(document).ready(function(){ var carousel=function(option){ this.carousel_inner_ul=option.carousel_inner_ul; this.count=option.count; this.width= this.carousel_inner_ul.width(); this.per_width=this.width/this.count; this.index=1; } carousel.prototype={ moveTo:function(index){ if(index>this.count)index=1; if(index<1)index=this.count; this.carousel_inner_ul.animate({"left":+(-(index-1)* this.per_width)+'px'},400); this.index=index; }, next:function(){ this.moveTo(++this.index); }, prev:function(){ this.moveTo(--this.index); } } var mycarousel=new carousel({ carousel_inner_ul:$('.inner_pic'), count:3 }); $('.pic_prev').click(function(){ mycarousel.prev(); }); $('.pic_next').click(function(){ mycarousel.next(); }); }); </script> </head> <body> <div class="out_pic"> <ul class="inner_pic"> <li><img src="img/1.jpg"></li> <li><img src="img/2.jpg"></li> <li><img src="img/3.jpg"></li> </ul> <a class="pic_prev pic_control">‹</a> <a class="pic_next pic_control">›</a> </div> </body> </html>
相关推荐
jquery 3D图片轮播插件
使用jQuery实现图片轮播html5手机web页面
jquery广告图片轮播,修改简单,可直接用,图片大小可修改等等
jquery焦点图片轮播滚动
jQuery实现图片轮播,这个项目实现前端网页经常用到的图片轮播功能。主要用到HTML、CSS和jQuery技术,非常适合前端入门练习。
简单的jquery层叠图片滚动轮播切换效果代码,带按钮的滚动轮播图
jquery mobile图片轮播插件,兼容性已解决~
jQuery广告banner轮播效果
jquery图片无缝轮播,飞牛网采用的轮播方法,喜欢的可以看一下
jquery实现图片轮播
jquery焦点图片轮播滚动类似选项卡滑动切换
jquery支持手机触屏的图片轮播效果jquery支持手机触屏的图片轮播效果
基于jquery的广告轮播,可以作为参照。
代码简介:jQuery图片相册轮播切换代码,功能强大,兼容性好,支持全屏轮播效果。
jquery 3D h5图片轮播效果
jQuery手机图片全屏滑动轮播效果代码是一款基于jquery.event.drag-1.5.min.js、 jquery.touchSlider.js和jquery-1.7.1.min.js等插件制作的图片轮播特效代码,兼容PC端和手机移动端,全屏宽屏 显示,支持鼠标点击切换...
基于jQuery carousel图片叠加旋转木马轮播切换效果,只要引入就可以 使用非常简单,基于jQuery carousel图片叠加旋转木马轮播切换效果,只要引入就可以 使用非常简单,
jquery图片轮播插件 左右、上下轮播jquery插件
基于jquery实现的图片轮播器,可自动播放,淡入淡出效果
这是一款简单的jquery 3d旋转轮播图效果。该轮播图基于bootstrap网格系统,通过jquery和CSS3 transforms来制作3D旋转效果,非常炫酷。