add topbar dropdown js

This commit is contained in:
Jacob Thornton
2011-08-27 21:46:50 -07:00
parent e91353f362
commit ed96f181c8
5 changed files with 132 additions and 128 deletions

36
examples/assets/css/bootstrap-js.css vendored Normal file
View 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;
}

View 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 )