diff options
author | Marius Halden <marius.h@lden.org> | 2015-11-16 11:15:10 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2015-11-16 11:15:10 +0100 |
commit | 1339a64632c441e4d7858bd5946738c9840c624d (patch) | |
tree | 0b1393ca9af05d1af690fbf6c569c195f4136e4c /web/cobrands/bromley/a-z-nav.js | |
parent | 17cc40a8a2387669984ae4a36bb0d30d889d1a07 (diff) | |
parent | 4fb5331abd2fa4c89ebeb89bc92a245fadd0aa19 (diff) |
Merge branch 'fiksgatami-dev' into fiksgatami-prod
Oppgrader prod til 1.7
Diffstat (limited to 'web/cobrands/bromley/a-z-nav.js')
-rw-r--r-- | web/cobrands/bromley/a-z-nav.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/web/cobrands/bromley/a-z-nav.js b/web/cobrands/bromley/a-z-nav.js new file mode 100644 index 000000000..75d984efa --- /dev/null +++ b/web/cobrands/bromley/a-z-nav.js @@ -0,0 +1,22 @@ +(function($){ + $(function(){ + // TOGGLE MENU + // Hides the items by default. + $('.custom-side-nav > ul > li > ul').hide(); + + // Stops the toggle links going off to their actual link. Make the links actual links though for non js users. + $('.custom-side-nav > ul > li > a').click(function(e) { + e.preventDefault(); + // When an item is clicked this checks to see if any other items are down and strips the class of active and toggles them up. + if( !$(this).hasClass('active') ) { + $('.custom-side-nav > ul > li > a.active').removeClass('active') + .next('ul') + .slideUp(300); + } + // This toggles a class of 'active' on the item in question and toggles the unordered list below it when it is clicked. + $(this).toggleClass('active') + .next('ul') + .slideToggle(300); + }); + }); +})(window.jQuery);
\ No newline at end of file |