Skip to content

Instantly share code, notes, and snippets.

@BHWD
Created August 14, 2018 13:18
Show Gist options
  • Save BHWD/4ba92525cb049c3c0885e20da1b7831c to your computer and use it in GitHub Desktop.
Save BHWD/4ba92525cb049c3c0885e20da1b7831c to your computer and use it in GitHub Desktop.
jQuery(document).ready(function($) {
if (jQuery('body').hasClass('ie')){
alert('ie');
} else {
console.log('sub menu width');
jQuery('.sub-menu').each(function() {
var width = 10;
jQuery('li', this).each(function() {
width += jQuery(this).outerWidth(true);
});
jQuery(this).css('width', width);
});
}
// IE Specific JS
if ( jQuery('body.ie').length ) {
console.log('dropdown icon');
jQuery('.menu-item-has-children a').append(' +');
} else {
console.log('it doesn\'t work');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment