From ed96f181c89a4bb152d58b5c9753ee5aedbd8c4b Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 27 Aug 2011 21:46:50 -0700 Subject: add topbar dropdown js --- examples/assets/css/bootstrap-js.css | 36 ++++++++++++ examples/assets/js/bootstrap-dropdown.js | 22 ++++++++ examples/bootstrap-js.html | 97 ++++++++++++++++++++++++-------- 3 files changed, 131 insertions(+), 24 deletions(-) create mode 100644 examples/assets/css/bootstrap-js.css create mode 100644 examples/assets/js/bootstrap-dropdown.js (limited to 'examples') diff --git a/examples/assets/css/bootstrap-js.css b/examples/assets/css/bootstrap-js.css new file mode 100644 index 000000000..1c741e3cb --- /dev/null +++ b/examples/assets/css/bootstrap-js.css @@ -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; +} \ No newline at end of file diff --git a/examples/assets/js/bootstrap-dropdown.js b/examples/assets/js/bootstrap-dropdown.js new file mode 100644 index 000000000..fd5bd7978 --- /dev/null +++ b/examples/assets/js/bootstrap-dropdown.js @@ -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 ) \ No newline at end of file diff --git a/examples/bootstrap-js.html b/examples/bootstrap-js.html index fe29cb644..2d9cea373 100644 --- a/examples/bootstrap-js.html +++ b/examples/bootstrap-js.html @@ -17,10 +17,11 @@ - + + @@ -29,7 +30,7 @@ - + @@ -38,8 +39,9 @@

Bootstrap JS

- + +
+ +
+ + + + @@ -265,7 +333,7 @@ $('#modal-content').modal({

$().popover

Initializes popovers for an element collection.

Demo

- hover + hover