Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

kadence-navigation js is causing the unwanted behavior

Home / Forums / Kadence Theme / kadence-navigation js is causing the unwanted behavior

This topic is: Resolved
[Resolved]
Posted in: Kadence Theme
  • This topic has 3 replies, 3 voices, and was last updated 5 years ago by Sloa.
April 1, 2021 at 1:04 pm

Hi,

Note: this should probably be passed to the developer.

I have made some custom popups which in the future I may release as a plugin. It works well with other themes, but with Kadence there’s a problem caused by ‘kadence-navigation’ located in /kadence/assets/js/navigation.min.js

Though, in my JS code I have preventing the default behavior of the popup linking with preventDefault(), still with Kadence theme, when the popup is triggered from the link/button:
– the page gets scrolled to the bottom (coz the popups are located there, i.e. hooked to the wp_footer)
– and the URL gets redirected to the anchored popup, i.e. domain.com/#popup1

These things do not happen with other themes I’ve used.

Previously I found that I can prevent the issue with the scrollTop, i.e. following:
`var current = $(window).scrollTop();
$(window).scroll(function() {
$(window).scrollTop(current);
});`
However, it occurs that the solution is unsustainable, since it has to be unlocked on the popup closing with .off(‘scroll’), which then is causing other functionality to stop working.

I’ve located that the issue is caused by ‘kadence-navigation’, since when I dequeue it the problem is gone. Can you investigate further and hopefully resolve this since I found the issue only with the Kadence theme. I do not have any public example since the code of my popups is only available on my local host. Still I hope I’m pointing you in the right direction with the file that is causing the problem and hopefully you may know what’s wrong with your code.

Thanks.

  • The forum ‘Kadence Theme’ is closed to new topics and replies.