"切換按鈕"
Bootstrap 3.3.0 Snippet by Arashi

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
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<link rel="stylesheet" href="http://www.bootcss.com/p/bootstrap-switch/static/stylesheets/bootstrapSwitch.css">
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.css">
<div class="container">
<div class="row">
<h2 class="text-center">Create your snippet's HTML, CSS and Javascript in the editor tabs</h2>
<div class="switch switch-large">
<input type="checkbox" checked />
</div>
<div class="switch">
<input type="checkbox" checked />
</div>
<div class="switch switch-small">
<input type="checkbox" checked />
</div>
<div class="switch switch-mini">
<input type="checkbox" checked />
</div>
<div class="switch" data-on="primary" data-off="info">
<input type="checkbox" checked />
</div>
<div class="switch" data-on="info" data-off="success">
<input type="checkbox" checked />
</div>
<div class="switch" data-on="success" data-off="warning">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
/**/
.aaa
{
display:none;
z-index:20;
position:absolute;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
$(document).ready(function() {
var $aaa = $('.aaa').toArray();
var size = $aaa.length;
// aaa
var i = 0;
delayedUpdatelist(i);
// 0 function
function delayedUpdatelist(x) {
if(x <= size){
$('.aaa:eq('+x+')').show("slow").delay(7000).fadeOut("slow");
//
// show 7 fadeOut
//fadeInfadeOutshow…anything
setTimeout(function(){ delayedUpdatelist(x+1) }, 8000);
// setTimeout function
// delay
} else {
x = 0;
$('.aaa:eq('+x+')').show("slow").delay(7000).fadeOut("slow");
setTimeout(function(){ delayedUpdatelist(x+1) }, 8000);
// x 0 0
}
}
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: