CMS Development

vjenck
Teilnehmer/-in

Links in the custom Header navigation bar not working

lösung

We launched our new website (Wordpress) last night, the custom header looks great but the links of navigation bar are not working. The rollovers work but nothing happens on click except for the logo in the center and the link to the HubSpot blog (which does not have child links).
I can do a right click and open the pages, which means the URLs are correct, but I cannot direct click down.

 

 

0 Upvotes
1 Akzeptierte Lösung
JasonRosa
Lösung
HubSpot Employee
HubSpot Employee

Links in the custom Header navigation bar not working

lösung

Hey @vjenck it looks like the links aren't clickable because of this bit of JavaScript in your main JavaScript file: 

 

$('.hs-item-has-children').click(function(e){
  e.preventDefault();
  $(this).toggleClass('open');
});

 

Essentially the target element that gets clicked within the "hs-item-has-children" class is getting the preventDefault method attached to it (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) which prevents the default link click behavior. 

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
3 Antworten
ashleyidesign
Stratege/Strategin | Partner
Stratege/Strategin | Partner

Links in the custom Header navigation bar not working

lösung

Are you referring to the header on your WordPress site? If so, I would recommend contacting the developer of your WordPress theme. If you're having an issue in HubSpot, then please link to the site so that I can take a look.

0 Upvotes
vjenck
Teilnehmer/-in

Links in the custom Header navigation bar not working

lösung

It is  the nav bar in HubSpot, you can see the behavior at https://know.bishopfox.com/blog

 

The nav bar in wordpress works very well: https://www.bishopfox.com

0 Upvotes
JasonRosa
Lösung
HubSpot Employee
HubSpot Employee

Links in the custom Header navigation bar not working

lösung

Hey @vjenck it looks like the links aren't clickable because of this bit of JavaScript in your main JavaScript file: 

 

$('.hs-item-has-children').click(function(e){
  e.preventDefault();
  $(this).toggleClass('open');
});

 

Essentially the target element that gets clicked within the "hs-item-has-children" class is getting the preventDefault method attached to it (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) which prevents the default link click behavior. 

0 Upvotes