aboutsummaryrefslogtreecommitdiff
path: root/examples/assets/js
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2011-08-27 21:46:50 -0700
committerJacob Thornton <[email protected]>2011-08-27 21:46:50 -0700
commited96f181c89a4bb152d58b5c9753ee5aedbd8c4b (patch)
treec0e5b3efebdae05ef1a8c4fae38c6e55f294725b /examples/assets/js
parente91353f36286d7d7d2fdde4d6107f7ecc4c815d6 (diff)
downloadbootstrap-ed96f181c89a4bb152d58b5c9753ee5aedbd8c4b.tar.xz
bootstrap-ed96f181c89a4bb152d58b5c9753ee5aedbd8c4b.zip
add topbar dropdown js
Diffstat (limited to 'examples/assets/js')
-rw-r--r--examples/assets/js/bootstrap-dropdown.js22
1 files changed, 22 insertions, 0 deletions
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