# Hubspot adding unwanted javascript that interferes with custom navigation

**URL:** <https://community.hubspot.com/t/hubspot-adding-unwanted-javascript-that-interferes-with-custom-navigation/9159>\
**Category:** CMS Development\
**Created:** [June 14, 2018, 9:20pm UTC](https://community.hubspot.com/t/hubspot-adding-unwanted-javascript-that-interferes-with-custom-navigation/9159 "2018-06-14T21:20:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lformdesign](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lformdesign/32/75439_2.png) [@lformdesign](https://community.hubspot.com/u/lformdesign)\
**Post date:** [June 14, 2018, 9:20pm UTC](https://community.hubspot.com/t/hubspot-adding-unwanted-javascript-that-interferes-with-custom-navigation/9159/1 "2018-06-14T21:20:14Z")

</div>

We have a custom navigation on our client’s hubspot site, but it recently became problematic. After troubleshooting the various scripts, enabling, disabling them, the problem was traced by to a javascript file being loaded with the site, that is not part of the site assets or in any of the folders:  
/hs/hsstatic/keyboard-accessible-menu-flyouts/static-1.2/bundles/project.js  
It seems to be included with the standard\_footer\_includes and is not found in either the site footer script settings, nor the pages script settings.  
Its adding mouseout events that interfere with the menu, is there any way to remove or disable this script?

---

<div class="post-metadata">

**Author:** ![roisinkirby](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@roisinkirby](https://community.hubspot.com/u/roisinkirby)\
**Post date:** [June 15, 2018, 8:02am UTC](https://community.hubspot.com/t/hubspot-adding-unwanted-javascript-that-interferes-with-custom-navigation/9159/2 "2018-06-15T08:02:49Z")

</div>

@lformdesign could you please share a link to the site you are working on and confirm if you are using custom coded templates, HubSpot’s drag and drop templates or a template you purchased from the HubSpot Marketplace?

---

<div class="post-metadata">

**Author:** ![lformdesign](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lformdesign/32/75439_2.png) [@lformdesign](https://community.hubspot.com/u/lformdesign)\
**Post date:** [June 15, 2018, 1:32pm UTC](https://community.hubspot.com/t/hubspot-adding-unwanted-javascript-that-interferes-with-custom-navigation/9159/3 "2018-06-15T13:32:17Z")

</div>

Thanks for the reply, the site is [https://www.redirectconsulting.com/](https://www.redirectconsulting.com/)  
The templates are custom coded.  
You can see the issue happening by clicking on ‘Services’ or ‘Solutions’, when the dropdown appears, if you move the mouse out of the \<a\> tag, the dropdown closes due to the mouseout event in that script I previously mentioned: [https://www.redirectconsulting.com/hs/hsstatic/keyboard-accessible-menu-flyouts/static-1.2/bundles/project.js](https://www.redirectconsulting.com/hs/hsstatic/keyboard-accessible-menu-flyouts/static-1.2/bundles/project.js)

Also, here is the menu template code for the navigation:

`{% menu id=XXX, overrideable='false', no_wrapper='true', max_levels='3', flyouts='false' %}`

---

<div class="post-metadata">

**Author:** ![roisinkirby](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@roisinkirby](https://community.hubspot.com/u/roisinkirby)\
**Post date:** [June 18, 2018, 10:39am UTC](https://community.hubspot.com/t/hubspot-adding-unwanted-javascript-that-interferes-with-custom-navigation/9159/4 "2018-06-18T10:39:58Z")

</div>

Did you originally develop these templates? @Jsum, @tjoyce are have you seen this script before?

---

<div class="post-metadata">

**Author:** ![ogavrilov](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ogavrilov/32/86357_2.png) [@ogavrilov](https://community.hubspot.com/u/ogavrilov)\
**Post date:** [June 18, 2018, 11:32am UTC](https://community.hubspot.com/t/hubspot-adding-unwanted-javascript-that-interferes-with-custom-navigation/9159/5 "2018-06-18T11:32:00Z")

</div>

Can you please look more into that issue? It breaked our site’s critical navigation flyouts. Why this script is included without any possibility to disable it?

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [June 18, 2018, 12:45pm UTC](https://community.hubspot.com/t/hubspot-adding-unwanted-javascript-that-interferes-with-custom-navigation/9159/6 "2018-06-18T12:45:46Z")

</div>

Unfortunately @roisinkirby, this is not a [belch.io](http://belch.io) template. I do have a quick fix for this though. I believe that projects.js script is a standard HS script that’s added to every template. The good news is that the script is targeting childrend directly of the “hs-menu-wrapper” class. So, a quick fix would be to drop this javascript into the template and then do a hard refresh in the browser.

```auto
$(function(){
 $('.hs-menu-wrapper').removeClass('hs-menu-wrapper');
});

```

And, even better news is that they don’t appear to be using that class selector in any css styles. So, this might end up being a permanent fix.

* * *

[tim@belch.io](mailto:tim@belch.io)

---

<div class="post-metadata">

**Author:** ![lformdesign](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lformdesign/32/75439_2.png) [@lformdesign](https://community.hubspot.com/u/lformdesign)\
**Post date:** [June 18, 2018, 8:43pm UTC](https://community.hubspot.com/t/hubspot-adding-unwanted-javascript-that-interferes-with-custom-navigation/9159/7 "2018-06-18T20:43:36Z")

</div>

@roisinkirbyThe template is original & custom coded by our team, we are not using any pre-fab templates or bits.

I can confirm that the fix suggested by @tjoyce works, much appreciated.

On Hubspot’s end, it would be preferable however if setting flyouts=‘false’ in the menu template function prevented that flyouts script from loaded altogether, or at least not initiate its event bindings. As it stands, that parameter seems to be more of a kind suggestion to the templating system rather than a hard setting. The fix @tjoyce came up with works but is a wee bit hacky in the context of the templating system.

Thanks again for the help @roisinkirby and @tjoyce.

---

<div class="post-metadata">

**Author:** ![chloekonig](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chloekonig/32/27794_2.png) [@chloekonig](https://community.hubspot.com/u/chloekonig)\
**Post date:** [November 12, 2018, 3:46pm UTC](https://community.hubspot.com/t/hubspot-adding-unwanted-javascript-that-interferes-with-custom-navigation/9159/8 "2018-11-12T15:46:29Z")

</div>

Thank you for the solution, @tjoyce! Our site is experiencing the same problem, however, the fix won’t work because it interferes with our CSS. Does anybody have any other solutions? The site that I am currently experiencing problems with is [Educational Presentations | Wellable](https://www.wellable.co/seminars-webinars).

Thank you!

 ![Messages Image(3986584260).jpeg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/a/0a2c94ac64e4bc1cc3968cb1016a487a04a1d38b.jpeg)  
This is how it looks like with the function
