Streaming live at 10am (PST)

How to use the scroll() javascript method in a webflow animation

Hi everyone!

Basically what I’m looking for is a way to scroll a div horizontally(will have position: sticky; top: 0;) based on when a section is scrolled to the top of the screen(ex. scroll into view webflow animation trigger. The div block will have links that go to there respective section on the page, but I’d like the links to scroll horizontally so that the “active” link is the very left most link shown at the top of the screen.
The only way I’m aware to scroll a div without manually doing it is via the javascript scroll() method. Is there a way to trigger custom code off of a webflow animation trigger, or maybe another way to scroll the div without using scroll() at all and instead using something entirely in webflow.


Hey @johnplataos
If I understood your requirements correctly you don’t need custom code for that sort of thing. You can do it only through wf interactions.
Here is a preview link of how it’s done, let me know if you have any questions, cheers!

1 Like