aboutsummaryrefslogtreecommitdiff
path: root/examples/assets/js
diff options
context:
space:
mode:
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