Archived topic
sticky navigation not working without jquery
7 replies · Started by Deepak on October 3, 2020
Hello,
I am using the release candidate of GP 3.X and in this theme the sticky navigation is not working if I jquery is disabled
is sticky navigation dependent on jquery?
I have added this in my functions.php
// Disable Jquery
add_filter( 'wp_enqueue_scripts', 'change_default_jquery', PHP_INT_MAX );
function change_default_jquery( ){
if ( ! is_admin() ) {
wp_dequeue_script( 'jquery');
wp_deregister_script( 'jquery');
}
}
With this the sticky navigation doesn't seem to work, when I comment out this function then the sticky navigation is working
Regards
Deepak
Hi there,
yes, the Sticky Navigation requires jQuery. It is the only part of the theme that does. We intend to move that to vanilla JS in the future
:(
Is it planned with the current 3.0 release?
Regards
Deepak
No.. its not a free theme option - its part of GP Premium, we have yet to find a method that will keep backward compatibility but it is something we're looking into.
Thanks David for this information
You're welcome
Hi there!
Tweak: Remove jquery-migrate from sticky script
Nice!
And how about a definite abandon of jQuery at front-end?
David, you've written:
We will be replacing jQuery in the next update with Vanilla JS
Means when?
Unfortunately we keep putting that on the back burner. There is not a good vanilla JS version that does all the features the current jQuery version does. So no time line for a replacement just yet.