-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
93 lines (93 loc) · 2.21 KB
/
demo.html
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
<!doctype html>
<html>
<head>
<title>jquery.toggleme</title>
<link href="css/jquery.toggleme.css" rel="stylesheet" />
<style>
h2
{
margin: 0;
}
p
{
margin-bottom: 0;
}
a
{
color: #00f;
cursor: pointer;
}
a:hover
{
text-decoration: underline;
}
.promo
{
background-color: #ffc;
margin-bottom: 1em;
padding: 1em;
}
</style>
</head>
<body>
<div id="header">
<h1>jquery.toggleme</h1>
</div>
<div id="main">
<div id="first" class="promo">
<h2>Toggle Me!</h2>
<div>
<p>This is how a toggleme acts by default. Exciting, isn't it?!</p>
</div>
</div>
<div id="second" class="promo">
<h2>icon: false</h2>
<div>
<p>For those who think icons are for wimps!</p>
</div>
</div>
<div id="third" class="promo">
<h2>autoOpen: true</h2>
<div>
<p>This is what happens when you set autoOpen to true.</p>
</div>
</div>
<div id="fourth" class="promo">
<h2>linkTitle: false</h2>
<div>
<p>This is what happens when you set linkTitle to false.</p>
</div>
</div>
<span id="open-fifth">
<a>Click me to open the toggleme below.</a>
</span>
<span id="close-fifth">
<a>No! Click me to close it.</a>
</span>
<div id="fifth" class="promo">
<h2>preventDefault: true</h2>
<div>
<p>This is what happens when you set preventDefault to true.</p>
<p>Try opening and closing this toggleme by using the links above.</p>
</div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/jquery.toggleme.js"></script>
<script>
$(function() {
$('#first').toggleme();
$('#second').toggleme({ icon: false });
$('#third').toggleme({ autoOpen: true });
$('#fourth').toggleme({ linkTitle: false });
$('#fifth').toggleme({ icon: false, autoOpen: true, linkTitle: false, preventDefault: true });
$('#open-fifth').click(function() {
$('#fifth').toggleme('open');
});
$('#close-fifth').click(function() {
$('#fifth').toggleme('close');
});
});
</script>
</body>
</html>