d4nyll / smartscroll

jQuery plugin for scrolljacking and auto-hashing
https://d4nyll.github.io/smartscroll/
MIT License
257 stars 45 forks source link

Scroll section with offset #41

Open Colir opened 6 years ago

Colir commented 6 years ago

Hi. I'm looking for a way to add an offset when scrolling down to my section. I've a fixed header, so my differents section's height is 100vh - header.height().

Is there a way to scroll to the sections with an offset of the header height ?

thanks a lot

d4nyll commented 6 years ago

It's been a while since I wrote this, so I don't remember if this is possible. You can try:

Alternatively, add a bit of padding to the top of each section to make up for the header.

Probably not what you're after, if it's not, reply here and I will mark it as a feature request.

Colir commented 6 years ago

unfortunately, mode to set and restricted section height are already in place. For the big padding solution, this doesn't work with images wich cover a section height : this add a big white (or bg color) gap.

It will be great if we can add a setting in the plugin option.

thank you for your feedback.