Jump to content
Search Community

webkit-keyframes to GSAP

Arthur Nobrega test
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

Hello, 

 

I have created an image slider using CSS.

 

@-webkit-keyframes 'slide'{
 
10%{
top: 5px;
}
 
11%,30%{
top:-360px;
}
 
31%,50%{
top:-720px;
}
 
51%, 70%{
top: -1080px;
}
 
71%,90%{
top: -1440px;
 

 

I would like to write this using TweenMax, so I can pause, go back, and skip images by hovering the cursor over menu options 

 

Thanks,

 

Arthur

Link to comment
Share on other sites

Hi Arthur and welcome to the GreenSock forums.

 

I've been dealing with some of this stuff lately and I created a bare-bone sample to build from.

 

See the Pen CeDkc by rhernando (@rhernando) on CodePen

 

It has an autoplay feature, pauses on mouse-over only if there is no animation currently happening and you can cilck any of the buttons and go to that specific slide. Like in the pause function the click works only if there's no other slide animating.

 

The code is insanely commented so you can get a good grasp of how everything works and why is there. The reason is that I'm thinking about building a jQuery plugin with this stuff. Still needs more animations options (is pretty lame as it is right now, especially considering all the options you have with GSAP) and correct the animation of the button background color. Unfortunately I'm needing 36 hour days lately :P, but as soon as I have more free time I'll get to it.

 

Rodrigo.

  • Like 2
Link to comment
Share on other sites

Thanks Rodrigo. 

 

I will give this a try. This is what I am trying to replicate:

 

http://www.amazon.com/Woodworking-Shop-Tools-Hardware/b/ref=amb_link_398727562_2?ie=UTF8&node=541016&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=hero-quick-promo&pf_rd_r=0CF36F1G4FPCWXES4TZ3&pf_rd_t=201&pf_rd_p=1716434662&pf_rd_i=B000JCT3W0

 

I think your example comes pretty close. 

 

Thanks again,

 

Arthur

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