forked from mdbootstrap/bootstrap-hover-dropdown
-
Notifications
You must be signed in to change notification settings - Fork 23
/
demo.html
142 lines (128 loc) · 6.38 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Twitter Bootstrap: Dropdown on Hover Plugin Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A demo for my simple plugin that enables twitter bootstrap dropdowns to activate on hover and provide a nice user experience.">
<meta name="author" content="Cameron Spear">
<!-- <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet"> -->
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet">
<style type="text/css">
body { padding-top: 60px; min-height: 410px }
@media only screen and (max-width: 979px) {
body { padding-top: 0; }
}
</style>
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="http://cameronspear.com/blog/twitter-bootstrap-dropdown-on-hover-plugin/">Dropdown Hover Plugin</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle js-activated">Home <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">Why Would</a></li>
<li><a tabindex="-1" href="#">A Home Tab</a></li>
<li><a tabindex="-1" href="#">Have Dropdowns?</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle js-activated">Account <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">My Account</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#">Change Email</a></li>
<li><a tabindex="-1" href="#">Change Password</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#">Logout</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle js-activated">Contact <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">Contact</a></li>
<li><a tabindex="-1" href="#">Contact My Mom</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#">Contact Your Mom</a></li>
<li><a tabindex="-1" href="#">Contact the President</a></li>
</ul>
</li>
</ul>
</div> <!-- .nav-collapse -->
</div> <!-- .container -->
</div> <!-- .navbav-inner -->
</div> <!-- .navbar -->
<div class="container">
<h1>Twitter Bootstrap: Dropdown on Hover Plugin Demo</h1>
<p>Hover over the nav items to see that they activate on hover. I'm setting the instantlyCloseOthers flag to true, so when you hover over a new nav item, the other ones instantly close (instead of waiting for their timeouts). See <a href="http://cameronspear.com/blog/twitter-bootstrap-dropdown-on-hover-plugin/">cameronspear.com/blog/twitter-bootstrap-dropdown-on-hover-plugin/</a> for more.</p>
<h2><em>New!</em> Try it with data-attributes</h2>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="http://cameronspear.com/blog/twitter-bootstrap-dropdown-on-hover-plugin/">Dropdown Hover Plugin</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-delay="1000">1000ms Delay <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">Why Would</a></li>
<li><a tabindex="-1" href="#">A Home Tab</a></li>
<li><a tabindex="-1" href="#">Have Dropdowns?</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-close-others="false">Doesn't Close Others <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">My Account</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#">Change Email</a></li>
<li><a tabindex="-1" href="#">Change Password</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#">Logout</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-hover="dropdown">Defaults <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">Contact</a></li>
<li><a tabindex="-1" href="#">Contact My Mom</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#">Contact Your Mom</a></li>
<li><a tabindex="-1" href="#">Contact the President</a></li>
</ul>
</li>
</ul>
</div> <!-- .nav-collapse -->
</div> <!-- .container -->
</div> <!-- .navbav-inner -->
</div> <!-- .navbar -->
</div> <!-- .container -->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<!-- // <script src="http://twitter.github.com/bootstrap/assets/js/bootstrap.min.js"></script> -->
<script scr="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
<script src="twitter-bootstrap-hover-dropdown.js"></script>
<script>
// very simple to use!
$(document).ready(function() {
$('.js-activated').dropdownHover();
});
</script>
</body>
</html>