Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ---------------------------------------------- /*
- * Navbar hover dropdown on desctop
- /* ---------------------------------------------- */
- function hoverDropdown(width, mobileTest) {
- if ((width > 991) && (mobileTest !== true)) {
- jQuery('.navbar-custom .navbar-nav > li.dropdown, .navbar-custom li.dropdown > ul > li.dropdown').removeClass('open');
- var delay = 0;
- var setTimeoutConst;
- jQuery('.navbar-custom .navbar-nav > li.dropdown').hover(function() {
- var jQuerythis = jQuery('li.dropdown');
- setTimeoutConst = setTimeout(function() {
- jQuerythis.addClass('open');
- jQuerythis.find('.dropdown-toggle').addClass('disabled');
- }, delay);
- },
- function() {
- clearTimeout(setTimeoutConst);
- jQuery(this).removeClass('open');
- jQuery(this).find('.dropdown-toggle').removeClass('disabled');
- });
- } else {
- jQuery('.navbar-custom .navbar-nav > li.dropdown, .navbar-custom li.dropdown > ul > li.dropdown').unbind('mouseenter mouseleave');
- jQuery('.navbar-custom [data-toggle=dropdown]').not('.binded').addClass('binded').on('click', function(event) {
- event.preventDefault();
- event.stopPropagation();
- jQuery(this).parent().siblings().removeClass('open');
- jQuery(this).parent().siblings().find('[data-toggle=dropdown]').parent().removeClass('open');
- jQuery(this).parent().toggleClass('open');
- });
- }
- }
Add Comment
Please, Sign In to add comment