Jump to content
Search Community

Horizontal Scrolling Page with Anchors

jadealombro test
Moderator Tag

Recommended Posts

Hey guys!

 

I am trying to work on a page that scrolls horizontally. Each section on the page has an indefinite width that depends on the content.

 

I am able to make the horizontal scroll work. I looked up some codes on how to get a menu section link on specific sections (including inner sections) through IDs but for some reason, the calculations for the scroll seem off.

 

I was hoping any of you can please point me in the right direction to get the links to work correctly where once a link item is clicked, the page should land on the right section of the page.

 

Thanks in advance.

See the Pen mdKamdK by jadebermas (@jadebermas) on CodePen

Link to comment
Share on other sites

  • 2 months later...

@mvaneijgen sorry if I wasn't clear but what I meant is what if I want to explicitly link to section three through an ID that is assigned to it?

 

For example, the third section will have the wrapper code:

 

  <section id="third" class="section section--small vh-100 flex-shrink-0 d-flex justify-content-center align-items-center">
    Part Three
  </section>

And I have a link on the page that's like:

 

<a class="scrollto" href="#third-section">Third Section</a>

Hope this clarifies it.

 

Thank you.

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...