smartscroll icon indicating copy to clipboard operation
smartscroll copied to clipboard

Scroll section with offset

Open Colir opened this issue 7 years ago • 2 comments

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

Colir avatar Jan 30 '18 15:01 Colir

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

  • Setting the mode option to set, this will use the height of each section as set by the CSS, and not expand it up to the whole viewport
  • Restrict your section wrapper to always be below your fixed header. So if the header takes 10% of the screen, the section wrapper would take another 90%.

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.

d4nyll avatar Jan 31 '18 20:01 d4nyll

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.

Colir avatar Feb 01 '18 09:02 Colir