初始化插件:
slides是一款基于jQuery无缝轮播图插件,支持图内元素动画,可以自定义动画类型
1
2
3
4
5
6
7
8
9
10
|
$( ".slideInner" ).slide({
slideContainer: $( '.slideInner a' ),
effect: 'easeOutCirc' , //动画类型
autoRunTime: 5000, //自动轮播时间
slideSpeed: 1000, //速度
nav: true , //是否显示左右导航
autoRun: true , //是否自动滚动
prevBtn: $( 'a.prev' ), //左按钮
nextBtn: $( 'a.next' ) //右按钮
}); |
兼容性: ie8+、google、firefox、360、QQ、欧朋、safi
html实例:
slides默认会为个个滑块里面的类名为moveElem的元素添加上动画的效果 元素上的rel属性则是设置对应的 延迟执行时间和动画类型两个属性 每个滑块内可同时添加多个元素
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
< body >
< div class = "slides" >
< div class = "slideInner" >
< a href = "#" style = "background: url(img/slide1.jpg) no-repeat;" >
< div class = "moveElem img1" rel = "0,easeInOutExpo" >
< img src = "img/slide1p1.png" />
</ div >
< div class = "moveElem img2" rel = "150,easeInOutExpo" >
< img src = "img/slide1p2.png" />
</ div >
</ a >
< a href = "#" style = "background: url(img/slide2.jpg) no-repeat" >
< div class = "moveElem img1" rel = "0,easeInOutExpo" >
< img src = "img/slide2p1.png" />
</ div >
</ a >
< a href = "#" class = "slide3" style = "background: url(img/slide3.jpg) no-repeat;" >
< div class = "moveElem img1" rel = "0,easeInOutExpo" >
< img src = "img/slide3p1.png" />
</ div >
< div class = "moveElem img2" rel = "150,easeInOutExpo" >
< img src = "img/slide3p2.png" />
</ div >
< div class = "moveElem img3" rel = "300,easeInOutExpo" >
< img src = "img/slide3p3.png" />
</ div >
</ a >
< a href = "#" style = "background: rgb(113, 209, 231);" >
< div class = "moveElem img1" rel = "0,easeInOutExpo" >
< img src = "img/slide1p1.png" />
</ div >
< div class = "moveElem img2" rel = "150,easeInOutExpo" >
< img src = "img/slide1p2.png" />
</ div >
</ a >
< a href = "#" style = "background: rgb(178, 44, 44);" >
< div class = "moveElem img1" rel = "0,easeInOutExpo" >
< img src = "img/slide1p1.png" />
</ div >
< div class = "moveElem img2" rel = "150,easeInOutExpo" >
< img src = "img/slide1p2.png" />
</ div >
</ a >
</ div >
< div class = "nav" >
< a class = "prev" href = "#" ></ a >
< a class = "next" href = "#" ></ a >
</ div >
</ div >
</ body >
|
Github地址:https://github.com/727712787/jquery.slides 下载地址:https://github.com/727712787/jquery.slides/archive/master.zip
来自:http://www.jb51.net/article/64306.htm