Jump to content
Search Community

Scrolltrigger resize issue

DexteRs Code test
Moderator Tag

Recommended Posts

I'm working with the scrolltrigger and smooth scrollbar js. In my demo below, as I resize my browser's height, all the sections will remain the same height as it was initially set (until you refresh), but the srolltrigger element changes its positions as if I've scrolled. In this demo the second and third h1 element changes the position as you resize the window height, but I don't want them to... Is there any way to stop this?

 

PS :To see the problem, I think you need to go to the codepen full screen by clicking on edit on codepen.

 

Thanks in advance!

See the Pen jOLBawG by dexterscode (@dexterscode) on CodePen

Link to comment
Share on other sites

22 minutes ago, DexteRs Code said:

but the srolltrigger element changes its positions as if I've scrolled.

 

The scroll position changes when you resize the height, that's why scroll bar size changes, so no, there is really nothing you can do about that. Users typically don't resize their screen to see how your animation looks, so it's nothing to really be overconcerned about.

 

  • Like 1
Link to comment
Share on other sites

I agree, at the first I thought the same, but when I tested this on mobileview and clicked on the text input field, the android soft keyboard appears and resizes the whole viewport's innerHeight and triggers the animation. That's the only reason.

But thanks for replying !!

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...