Jump to content
Search Community

image zoom and zoom out on scroll

renny test
Moderator Tag

Recommended Posts

On 10/9/2021 at 4:16 PM, Cassie said:

Hi Renny,

 

Sure, that's relatively simple.

Have you checked out the scrollTrigger docshttps://greensock.com/docs/v3/Plugins/ScrollTrigger

If you set up a minimal demo with the necessary HTML and styling we'll be able to nudge you in the right direction.

if you don't mine but can you share anyone demo like that, so i can implement from there

Link to comment
Share on other sites

 

gsap.to('img', {
  scale: 1.5,
  duration: 1,
  scrollTrigger: {
    trigger: 'img',
    markers: true,
    scrub: true,
    start: 'bottom bottom'
  }
})


If you add the line scrub:true to your scrollTrigger the animation will synch with the scroll. This is detailed in the second code snippet on the docs page I linked you to. 

Please read the documentation or attach a demo of something you've tried before asking any more questions.

Good luck with your project


 

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