Last active
December 15, 2015 01:59
-
-
Save yramagicman/5183766 to your computer and use it in GitHub Desktop.
add a pad around dropdown menus to compensate for mouse error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { //jQuery function that adds a pad around menus | |
'use strict'; | |
var x, j; | |
j = jQuery.noConflict(); | |
//detect elements | |
var wrapPad = function(elem) { | |
if (j(elem).length) { | |
x = j(elem); | |
x.wrap('<div class="pad">'); | |
j(elem).addClass('force-show'); | |
} | |
}; | |
var elems = ['nav .children', 'nav .sub-menu']; | |
for (var i = elems.length - 1; i >= 0; i--) { | |
wrapPad(elems[i]); | |
} | |
})(); // end menus |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment