mirror of
https://github.com/jasny/bootstrap.git
synced 2026-02-15 16:25:08 -05:00
add topbar dropdown js
This commit is contained in:
36
examples/assets/css/bootstrap-js.css
vendored
Normal file
36
examples/assets/css/bootstrap-js.css
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
body {
|
||||
padding-bottom: 60px;
|
||||
}
|
||||
/* Topbar special styles
|
||||
-------------------------------------------------- */
|
||||
div.topbar-wrapper {
|
||||
position: relative;
|
||||
height: 40px;
|
||||
margin: 5px 0 15px;
|
||||
}
|
||||
div.topbar-wrapper div.topbar {
|
||||
position: absolute;
|
||||
margin: 0 -20px;
|
||||
}
|
||||
|
||||
div.topbar-wrapper div.topbar .fill {
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
div.topbar-wrapper .container {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
/* Pretty Print
|
||||
-------------------------------------------------- */
|
||||
PRE.prettyprint {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
section {
|
||||
padding-top: 60px;
|
||||
}
|
||||
22
examples/assets/js/bootstrap-dropdown.js
vendored
Normal file
22
examples/assets/js/bootstrap-dropdown.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(function( $ ){
|
||||
|
||||
/* DROPDOWN PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
function clearMenus() {
|
||||
$('a.menu').parent('li').removeClass('open')
|
||||
}
|
||||
|
||||
$(window).bind("click", clearMenus)
|
||||
|
||||
$.fn.dropdown = function ( options ) {
|
||||
return this.each(function () {
|
||||
$(this).delegate('a.menu', 'click', function (e) {
|
||||
clearMenus()
|
||||
$(this).parent('li').toggleClass('open')
|
||||
return false
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
})( jQuery || ender )
|
||||
Reference in New Issue
Block a user