-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
109 lines (109 loc) · 4.26 KB
/
index.html
File metadata and controls
109 lines (109 loc) · 4.26 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/core.css">
<link rel="stylesheet" href="css/prism.css">
</head>
<body>
<div class="navbar">
<div class="inner">
<ul class="nav">
<li><a href="#Markup">Markup</a></li>
<li><a href="#Options">Options</a></li>
</ul>
<h1>A Simple Switch <span class="ver">1.0 Beta</span></h1>
</div>
</div>
<div class="switches">
<div class="switch" id="switchFade">
<div class="item">
<img src="img/1.jpg" alt="">
</div>
<div class="item">
<img src="img/2.jpg" alt="">
</div>
<div class="item">
<img src="img/3.jpg" alt="">
</div>
<div class="item">
<img src="img/4.jpg" alt="">
</div>
<div class="item">
<img src="img/5.jpg" alt="">
</div>
</div>
</div>
<div class="context">
<div class="section">
<h2>简介</h2>
<p>一款基于 <code>jQuery</code> 的焦点图切换插件。并且基于 <code>CSS3</code> 实现动画(高级浏览器)。</p>
<p>本着表现和行为分离的原则,<code>CSS3</code> 动画部分的效果直接在样式中声明,通过类名来 <code>Hold</code> 住。</p>
<p>不支持 <code>CSS3</code> 动画效果的浏览器使用 <code>jQuery</code> 实现动画效果降级。</p>
<p>提供四种动画效果: <code>fade, slide, slideUp, slideDown</code> 。</p>
</div>
<div id="Markup" class="section">
<h2>结构</h2>
<pre class="language-markup"><code><!DOCTYPE HTML>
<html>
<head>
<title>Switch</title>
<link rel="stylesheet" href="css/core.css">
</head>
<body>
<div class="switch" id="switchFade">
<div class="item">
<img src="img/1.jpg" alt="">
</div>
<div class="item">
<img src="img/2.jpg" alt="">
</div>
<div class="item">
<img src="img/3.jpg" alt="">
</div>
<div class="item">
<img src="img/4.jpg" alt="">
</div>
<div class="item">
<img src="img/5.jpg" alt="">
</div>
</div>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="switch.js"></script>
<script>
$(function(){
$('#switchFade').switches();
});
</script>
</body>
</html></code></pre>
</div>
<div id="Options" class="section">
<h2>参数</h2>
<pre class="language-javascript"><code>$(function(){
$('#switchFade').switches({
'wrapClass' : 'switch-in' // @param {[String]} The class name of the switch container
'onClass' : 'active', // @param {[String]} The class name of current item
'control' : true, // @param {[Boolean]} Whether to show the prev/next control button
'effect' : 'fade', // @param {[String]} The animation effect, default is 'fade'
'prev' : '‹', // @param {[String]} The text of the prev button
'next' : '›', // @param {[String]} The text of the next button
'interval' : 3000, // @param {[Number]} The interval of play
'auto' : true, // @param {[Boolean]} Whether to play auto
'page' : true, // @param {[Boolean]} Whether to show pagination
'idx' : 0 // @param {[Number]} The initial index of the item in the begin
});
});</code></pre>
</div>
</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/switch.js"></script>
<script type="text/javascript" src="js/prism.js"></script>
<script>
$('#switchFade').switches({
'effect' : 'slide'
});
</script>
</body>
</html>