- This topic has 9 replies, 4 voices, and was last updated 9 months ago by
Tom.
-
AuthorPosts
-
June 4, 2019 at 4:22 am #919386
Sebastien
Hi,
Smooth Scroll doesn’t work into my website.. =/
I’ve writen some anchors along my front page. Then I’ve writen some link to point to these anchor:
<a class="smooth-scroll" href="#application">My Section</a>
When I click into the link, it links me to the right anchor #application, but there is no any smooth scroll effect =/
I’ve also add:add_filter( 'generate_smooth_scroll_duration', 'tu_smooth_scroll_duration' ); function tu_smooth_scroll_duration() { return 800; // milliseconds }
but that doesn’t work.. Any idea?
thanksJune 4, 2019 at 5:03 am #919419David
StaffCustomer SupportHi there,
have you activated the smooth scroll option in Customizer > General ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 4, 2019 at 5:27 am #919432Sebastien
Yes I have already activated this option
June 4, 2019 at 5:46 am #919440David
StaffCustomer SupportClicking the Section link is working for me. Maybe try clearing the browser cache.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 4, 2019 at 6:53 am #919618Sebastien
I’ve noticed it also work with smartphone devices… but neither with my desktop Chrome or Firefox after full cleared…
humm strange..June 4, 2019 at 7:04 am #919631David
StaffCustomer SupportWorking fine for me on all browsers – any browser extensions that could be conflicting ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 22, 2020 at 9:20 am #1249500Marcel
Hello. Related to the smooth scroll behaviour:
– If I apply smooth scroll to regular links (https://docs.generatepress.com/article/smooth-scroll/#regular-links), all is good to go, it works as expected, but…
– I tried to apply the smooth-scroll class to a headine on GenerateBlocks. The behaviour changes and the anchor link sends me under the Element ID. Is it a trick here?
I made a short VIDEO HERE to explain better.
Thank you for your support.
MarcelApril 22, 2020 at 4:14 pm #1250068Tom
Lead DeveloperLead DeveloperAh, the custom class option in GenerateBlocks adds the class to the headline element, not the anchor.
Try adding this filter:
add_filter( 'generate_smooth_scroll_elements', function( $elements ) { $elements[] = '.gb-headline.smooth-scroll a'; return $elements; } );
Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentApril 23, 2020 at 1:32 am #1250652Marcel
Tom, thank you very much for the solution. It is working properly now!
April 23, 2020 at 8:55 am #1251630Tom
Lead DeveloperLead DeveloperGlad I could help π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.