This jQuery is not working with Firefox only
I'm using it for megamenu. It's working fine on Google Chrome, Edge, Brave, and Opera.
It's not working on Firefox only.
I have also put this jQuery between <head> tag. Still, not working.
/*jshint esversion: 6 */ jQuery(document).ready(function($) {
"use strict"; // Mega menu (with tabs) $(window).load(function(){ $('.megamenu-tabs').each(function(){$( '.menu-item', this ).wrapAll( '
- ');
$( '.tab-content', this ).wrapAll( '
- ');
$( '.tabs-nav, .tabs-content-wrapper', this ).wrapAll( '
I'm using it for megamenu. It's working fine on Google Chrome, Edge, Brave, and Opera.
It's not working on Firefox only.
I have also put this jQuery between <head> tag. Still, not working.
/*jshint esversion: 6 */
jQuery(document).ready(function($) {
"use strict";
// Mega menu (with tabs)
$(window).load(function(){
$('.megamenu-tabs').each(function(){
$( '.menu-item', this ).wrapAll( '<ul class="tabs-nav" />');
$( '.tab-content', this ).wrapAll( '<ul class="tabs-content-wrapper" />');
$( '.tabs-nav, .tabs-content-wrapper', this ).wrapAll( '<li class="submenu-content" />');
$('ul.sub-menu', this).show();
$('.tab-content:not(:first-child)', this).addClass('tab-hidden');
$('.tabs-nav li:first-child', this).addClass('nav-active');
$('.tabs-nav li', this).hover(function() {
var tabId = $(this).attr('id');
$(this).closest('.tabs-nav').find('li').removeClass('nav-active');
$(this).addClass('nav-active');
$(this).closest('.submenu-content').find('li.tab-content').addClass('tab-hidden');
$(this).closest('.submenu-content').find('li.'+tabId).removeClass('tab-hidden');
});
var highestTab = $('.tabs-content-wrapper', this).outerHeight();
$('.tabs-nav', this).css( 'min-height', highestTab-40 );
});
});
});