Sha256: d321588a53b2a7aaef7298d347150d2cc84d922ff22b9a1f75e82b84a49a94aa
Contents?: true
Size: 749 Bytes
Versions: 98
Compression:
Stored size: 749 Bytes
Contents
(function(Dropdown, $) { Dropdown.setup = function(link) { var menuToWrap = Dropdown.findMenu(link); if ($(menuToWrap).parent("div").length == 0) { menuToWrap.wrap("<div class='dropdown_wrapper' style='position: absolute; display: none'></div>"); $(link).on('click', function (event) { event.preventDefault(); $(this).toggleClass('selected'); Dropdown.findMenu(this).closest('.dropdown_wrapper').slideToggle(); }) }; } Dropdown.findMenu = function(link) { var match = $(link).attr('href').match(/\#(.+)$/)[1]; return $('#' + match); } }(window.Dropdown = window.Dropdown || {}, jQuery)); $(function () { $('a.dropdown').each(function(){ Dropdown.setup(this); }); });
Version data entries
98 entries across 98 versions & 1 rubygems