Archived topic
Front Page Hero
25 replies · Started by Puneet on May 10, 2022
If i tap somewhere else on the screen before tapping the Start Now link then the smooth scroll works.
Do you have optimizations on the site that defers script loading until user interaction ?
Yes, I do have that optimization (JS and CSS) through Perfmatters. Do I need to exclude something?
Regards,
Puneet
You're not using sticky navigation ?
If you're not then - disable the GP Smooth Scroll and add this CSS:
html {
scroll-behavior: smooth;
}
It works fine, but back to top button loses functionality. I don't use sticky header etc., but back to top could be useful for longer articles.
Damn - forgot about that.
OK so remove the CSS and re-enable the GP smooth scroll.
And exclude this script from the optimization.
wp-content/plugins/gp-premium/general/js/smooth-scroll.min.js
Hi David,
The exclusion didn't work. After putting in the exclusion, all featured images disappeared.
well thats super bizarre as theres no reason that should happen.
Can you check with Perfmatters support? Brian knows the theme inside and out so should be able to advise how to exclude the script without stuff breaking.
Thanks, David; I will get in touch with the Perfmatters team.
Regards,
Puneet
Let us know what they say!
Hi David,
Perfmatters resolved it, and this was the cause:
"Images disappearing were being caused by a cascading console error. There was just an inline script that needed to be excluded along with the main smooth scroll script."
The solution was these two exceptions:
1. smooth-scroll.min.js
2. smooth
Regards,
Puneet
Glad to hear you got it resolved, and thanks for sharing that!