Plugin Author
malihu
(@malihu)
Hi,
Which button in which page?
The page is this:
https://www.tenerife-trips.com/product/water-sports/jet-ski-tenerife/
The button is the one “PRICES” in the middle of the page just below “SCHEDULE & PICKUP SERVICE”.
Basically the idea is to take users to the prices at the bottom of the page when they click that button.
I have called “prices jet ski” the element ID of the empty space just above the yellow area where the prices are. Then I put as URL of the button “#prices jet ski”.
I can see that it works, but it jumps to the point not scroll (it works even when the plugin Page scroll to id is deactivated).
Plugin Author
malihu
(@malihu)
Spaces are not allowed in html id attributes. Your id is prices jet ski and your link URL is #prices jet ski, which then becomes #prices%20jet%20ski by the browser’s rendering engine, as spaces are replaced with %20 since they are invalid characters.
Change your id to:
prices-jet-ski
and your link’s URL to:
#prices-jet-ski
and everything will work.
You should only use letters, numbers, - and _ in ids.
Let me know
Yes now it works, thank you very much.
It works also when the plugin Page scroll to id is deactivated, is that normal?
Plugin Author
malihu
(@malihu)
It’s probably another script in your theme that hijacks smooth scrolling.
Go to plugin settings and enable “Prevent other scripts from handling plugin’s links” option and set the “Prevent other scripts from handling plugin’s links selector(s)” field value to:
a[href*='#']:not([href='#'])
Also, since you have a sticky top header menu, set the “Offset” option value to:
#site-header
Save changes and let me know so I can test it.
Actually I deleted the plugin Page scroll to id and it still works fine now, so I suppose my theme already offers such scroll?!
Thanks a lot anyway for your help
Plugin Author
malihu
(@malihu)
Yes. If you don’t want plugin’s functionality like offsetting your sticky menu, scrolling to target from/to different pages etc. you can do without it.