#Adding section links to a momentum scrolling JS library

12 messages · Page 1 of 1 (latest)

nocturne crypt
#

Does anyone know how I can get the section links to work within this library?
My best guess is to figure out a way I can maybe add a css class that can be used to register the link and set up for the momentum scroll to work based on a stored y coord?
Not too well versed in JS so it's a bit of a struggle.

I've set it all up in a codepen to mess with
https://codepen.io/Darryll-L/pen/MWPZLdv

upbeat urchin
#

I am not sure what the problem is

#

What are you trying to do?

nocturne crypt
#

These links

  <ul class="menu">
    <li><a href="#section1">Section 1</a></li>
    <li><a href="#section2">Section 2</a></li>
    <li><a href="#section3">Section 3</a></li>
  </ul>

Do not work with the momentum scrolling active

#

I need to add something to accommodate them if possible

#

So internal links to certain sections don't work

#

(If you comment out all the JS you will see the regular functionality)

upbeat urchin
#

gotcha

upbeat urchin
nocturne crypt
#

Possibly, I'll try it when I can. Just not amazing with js

upbeat urchin
#

Me neither haha

nocturne crypt
#

Ahaha thank you anyway, my concern is that the way the smooth scrolling works I'm not sure how getting the co ords for the elements will work.

It basically completely detachs the content from the scroll then animates it seperately based on scroll bar value.