搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

This jQuery is not working with Firefox only

  • 無回覆
  • 1 有這個問題
  • 3 次檢視
more options

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 ); }); }); });

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題