Jump to content
Search Community

Horizontal Scroll prevent and then allow

Mental Republic
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Mental Republic
Posted

Hi, i have set up a codepen, we are using both scrollmagic and tweenmax to achieve the following. 

 

There is a line that is drawn while horizontally scrolling, the idea is to prevent the image carousel from moving at the start of the horizontal scroll (only letting the line to be drawn) until the line reaches a point, at that very  same point the line keeps on drawing and we can move the carousel horizontally. 

See the Pen RezvBP by ivanguinea (@ivanguinea) on CodePen.

Posted

I'm not sure I follow the question. It kinda sounds like you may want to pin the image carousel until the line gets to it? But I'm really not sure I understand the desired outcome here. Could you be more specific about the desired behavior and how GSAP plays a role in it?

 

Thanks and happy tweening.

:)

 

  • Like 4
Mental Republic
Posted

yeah! You pointed me in the right direction, however i still have some issues with the code. 

 

I updated the codepen add add the setpin to the images for period of time:

 

See the Pen RezvBP by ivanguinea (@ivanguinea) on CodePen.

The thing now I cannot scroll over the images because they are set as display fixed, so i cannot scroll horizontally over them. Dunno what i am missing here...

Posted

Sorry, I'm still confused about what this should be doing. I'm also not seeing any images. Just a yellow box. 

 

Are the images part of the scroll animation? Or does the line animate to the images and then the user can navigate the images? If the images are not part of the scroll, how does the user control it?

 

 

  • Like 2
Mental Republic
Posted

Sorry about that, the whole thing is letting the line be completed before the images (i just changed the images for yellow bricks) gets moved. The line gets completed when the images are not set as set pin, but i need those images to be fixed when the lines start drawing.

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