same here! offset doesn’t work if coming from other pages.
it would be great if you can help us. thanks for the good work and your very helpful plugin.
Had the same issue on my site too. I had a fixed header nav roughly 180px tall. When user was on page and clicked anchor on that page, smooth scroll worked fine, but if user entered anchor URL manually e.g. mysite.com/#anchor, or clicked on the anchor link from another page (site is mostly one pager, but a few side pages) the offset would drop them too far.
It’s because the offset setting (default 20, adjust under Settings > ESSL Settings) wasn’t getting loaded before browser sent user to anchor location. This could probably be fixed with preventDefault() or setTimeout(), but it can be easily fixed with CSS magic.
I set my offset to 0 in the plugins settings.
Then I created a anchorOffSet class in my custom css for my theme
.anchorOffSet {
padding-top: 200px;
margin-top: -200px;
}
My setting positive padding-top and negative margin-top, you offset the anchor without creating any gaps in your page’s content. (Note: I used 200 because my fixed nav header was 180px high so this gave some spacing between anchor and top of screen, change to whatever works for you)
Have a look at the final result (one of many anchor links on this)
https://www.betterworldwireless.com/#mission
I’m reopening this thread because have the same issue too.
No matter what value I enter in the options or even when I edit the plugin itself, the offset is not used (and the first part of the anchor gets covered by the banner).
I am on the latest version as suggested by Jeriff (thank you for creating this plugin btw).
Suggestions on how to solve this are most welcome.
(Unfortunately the site is “under construction” and I cannot show the problem).
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
You still need to open a new thread; https://wordpress.org/support/plugin/easy-smooth-scroll-links#postform
Don’t worry not posting in someone else’s thread doesn’t classify an issue as not existing.