Closed yudiznilay closed 5 years ago
This is a known issue with the jQuery updater.
Go to plugin settings and change the "Selector(s)" option to:
a[href*='#']:not([href='#'])
Save changes and test your page.
This "fix" is already implemented and will be public in the next plugin version (1.6.5). You can download and use plugin's development version (which has this fix) if you want:
https://downloads.wordpress.org/plugin/page-scroll-to-id.zip
I tried the above solution but still no luck in sparkling theme. It's working fine in Twentynineteen theme. Below are the attached videos.
Go to plugin settings and enable/check the "Prevent other scripts from handling plugin’s links" option. Save changes and test.
Still the same. Browser shows error as follows:
Firefox: TypeError: a.selector is undefined[Learn More] page-scroll-to-id.min.js:2:13192 p http://localhost/one-page/wp-content/plugins/page-scroll-to-id/js/page-scroll-to-id.min.js:2
Can you make a test by deactivating jQuery updater and see if it works?
I deleted that plugin but shows the same error.
Hey, I've found the issue. I'll post an update here asap.
OK. I've just pushed a fix for this issue in plugin's development version here: https://downloads.wordpress.org/plugin/page-scroll-to-id.zip
Please (re)download/install/activate. After (re)activation, go to plugin settings and enable/check the "Prevent other scripts from handling plugin’s links" option. Save changes and test again. It should work now.
Let me know :)
That removed the error but the smooth scroll is still not working. Any idea why?
Not sure. I've installed in a test environment the latest WordPress, WPBakery Page Builder and Sparkling theme. Created few menu links and a couple targets (as described here) and everything works as expected.
Do you have "Prevent other scripts from handling plugin’s links" option enabled?
What links have you created and how did you created them?
Do you have "Prevent other scripts from handling plugin’s links" option enabled? - Yes
What links have you created and how did you created them? : I have created custom links in Menu and given the link for first- #section1, second- #section2 and so on... And have added id in the Row ID field as section1, section 2 and so on... Selector in page scroll to id field : a[href*='#']:not([href='#']) Excluded selector as provided in the plugin: a[href^='#tab-'], a[data-toggle].
Let me know if I am missing something.
Seems that everything you've done is correct. There must be a script that prevents "Page scroll to id" from scrolling the page but I can't tell which. Every test I've done with wpbakery and sparkling theme (and jQuery updater) works for me.
Is it possible for me to see your site? I'd probably be able to provide an exact solution if I could see which script causes the issue.
I have sent credentials to your mail (manos@malihu.gr)
Thanks. I've just replied to you by email.
Many thanks, it worked. Thank you for your support. 👍 I have overridden its function in the child theme by this code:
add_action( 'init', 'remove_my_action'); function remove_my_action() { remove_action( 'wp_footer','sparkling_make_top_level_menu_clickable',1 ); }
function sparkling_menu_clickable() { if ( ! wp_is_mobile() ) { ?>
<?php
}
}
add_action( 'wp_footer', 'sparkling_menu_clickable', 1 );
Great. Glad I helped :)
I think you have a typo in your code. Change the line:
$('.navbar-nav > li.menu-item > a.not("a[href*='#']:not([href='#'])').click(function () {
to:
$('.navbar-nav > li.menu-item > a').not("a[href*='#']:not([href='#'])").click(function () {
Okay, thanks for the update and correction. 👍
Smooth scroll in the sparkling theme is not working. Clicking on the menu link directly jumps to section. It works perfectly in twenty nineteen theme.
jQuery version - 3.3.1
Plugins installed: WPBakery Page Builder jQuery updater Disable Gutenburg.