Title: Dynamic Sub Menu Width &#8211; jQuery error
Last modified: July 12, 2019

---

# Dynamic Sub Menu Width – jQuery error

 *  Resolved [up660959](https://wordpress.org/support/users/up660959/)
 * (@up660959)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/dynamic-sub-menu-width-jquery-error/)
 * I have followed the [https://www.megamenu.com/documentation/adjust-sub-menu-width/](https://www.megamenu.com/documentation/adjust-sub-menu-width/)
   guide to add dynamic sub menu width to my mega menu.
 * After saving the changes. I navigate to my page. And the page does not load at
   all. When I open the console I can see lots of the below error.
 * “Uncaught RegerenceError: jQuery is not defined”
 * Clicking into these errors I can see that a carousel part of the page that the
   theme uses is using jQuery and throwing these errors.
 * If I go back to Word Press and remove the class from the panel width – outer 
   width setting then the page loads just fine.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/dynamic-sub-menu-width-jquery-error/#post-11732102)
 * Hi up660959,
 * Please can you post a link to your site so I can take a look?
 *  Thread Starter [up660959](https://wordpress.org/support/users/up660959/)
 * (@up660959)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/dynamic-sub-menu-width-jquery-error/#post-11732126)
 * Hi MegaMenu,
 * It is my companies staging site which is currently behind username/password so
   unable to share with you on this forum. Unless there is another way?
 * From my testing this morning I have found that If I disable the W3 Total Cache
   plugin then the menu’s sub menu behaves dynamically and extends to the specified
   selector
 *  Thread Starter [up660959](https://wordpress.org/support/users/up660959/)
 * (@up660959)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/dynamic-sub-menu-width-jquery-error/#post-11732182)
 * Just performed some further tests.
 * The site is currently using the LeadEngine Theme.
 * From what I have found I have narrowed the problem down to the Minify option 
   within W3 total cache.
 * **When it is enabled **
    – The dynamic sub menu width option does not work and
   the sub menu only extends to the length of the menu itself
 * **When it is disabled**
    – The dynamic sub menu width works as described in option
   3 on [https://www.megamenu.com/documentation/adjust-sub-menu-width/](https://www.megamenu.com/documentation/adjust-sub-menu-width/)
 * -However with Minify disabled the ‘Meet the team’ section of the theme breaks,
   which I need to be working.
 * Is there anything else I can try?
 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/dynamic-sub-menu-width-jquery-error/#post-11732322)
 * Hi up660959,
 * Is there an option in w3totalcache to exclude a file from being minified? If 
   so, try adding the maxmegamenu.js file to that list (you might need to find the
   full url to that file by inspecting your page source).
 * Alternatively you could try a different caching plugin, I know we have a lot 
   of users who use Autoptimize.
 *  Thread Starter [up660959](https://wordpress.org/support/users/up660959/)
 * (@up660959)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/dynamic-sub-menu-width-jquery-error/#post-11762547)
 * Thanks for the response. I am still trying to troubleshoot this issue. Do you
   know what the relative file paths of the Mega Menu files will be (or how I can
   find this out) so that I can add them to the exclusion list.
 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/dynamic-sub-menu-width-jquery-error/#post-11762800)
 * Hi up,
 * Try:
 * `/wp-content/plugins/megamenu/js/maxmegamenu.js`
 * (You can disable your caching plugin, then view the page source and you should
   be able to find the paths)
 * I would advise trying a different plugin like Autoptimize, which is like a more
   modern version of w3 total cache.
 * Regards,
    Tom
 *  Thread Starter [up660959](https://wordpress.org/support/users/up660959/)
 * (@up660959)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/dynamic-sub-menu-width-jquery-error/#post-11777280)
 * Hi,
 * This is now resolved.
 * Turns out there was two performance plugins running.
 * I turned one off and then excluded the maxmega menu file.
 * Thanks for your support

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Dynamic Sub Menu Width – jQuery error’ is closed to new replies.

 * ![](https://ps.w.org/megamenu/assets/icon-128x128.png?rev=1489843)
 * [Max Mega Menu](https://wordpress.org/plugins/megamenu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/megamenu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/megamenu/)
 * [Active Topics](https://wordpress.org/support/plugin/megamenu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/megamenu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/megamenu/reviews/)

## Tags

 * [dynamic menu](https://wordpress.org/support/topic-tag/dynamic-menu/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [width](https://wordpress.org/support/topic-tag/width/)

 * 7 replies
 * 2 participants
 * Last reply from: [up660959](https://wordpress.org/support/users/up660959/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/dynamic-sub-menu-width-jquery-error/#post-11777280)
 * Status: resolved