dollarshaveclub/scrolldir

Start default up

datnordstrom opened this issue · 6 comments

How do I make it so it start in the data-scrolldir="up" at app start?

Thanks for your question!

What is the scenario where you need to scroll up when your app starts?

Have a menu appear by default and then later when the user scrolls back up the menu appears.

Oh, I think I may have something for you to look at for reference. 😊

https://content.dollarshaveclub.com/basic-dad-worry-kid-fat <-- look at that on a smaller view and let me know if that is similar to what you're doing—there are 2 nav items that have sticky functionality and show up on scroll ⬆.

yes that is what i am trying to achieve!

Awesome! You can view the css that is used to achieve that on the page.

Hi ! I've the feeling that scrollDir({ direction: 'up' }); won't work anymore (i've installed ScrollDir just right now).

As soon as my HTML page is loaded, I see "data-scrolldir="down"" as attribute in my HTML tag.
I've forced "data-scrolldir="up"" in my HTML page, load the JS with scrollDir({ direction: 'up' }); and no, it's "down" in my tag so I thank it's doesn't work anymore.

Can you check please ?

(My need : I'm showing a header on "up" and hide it on "down" and, at the first display of the page, I wish to keep it showed)