Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
edonbajrami

Stop(true,false) in Greensock

Recommended Posts

Hi i have two links with animation:

 

var tl = new TimelineLite();
    tl.to($(this).find('.top'), 0.1, {width:"100%"})
      .to($(this).find('.right'), 0.1, {height:"100%"})
      .to($(this).find('.bottom'), 0.1, {width:"100%"})
      .to($(this).find('.left'), 0.1, {height:"100%"});
 

But when i am hovering fast between this two items animation is not finished like stop(true,false). How can i implement that in Greensock ?

See the Pen itmeB by jonathan (@jonathan) on CodePen

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

It is very hard to diagnose the issue from the partial code you have provided.

It is much better if you provide a reduced test case that we can test, edit and fix.

Please create a CodePen demo with as little HTML, CSS and JavaScript necessary to replicate this behavior.

Instructions on how to do that are here: http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/

 

Thanks!

  • Like 1
Link to comment
Share on other sites

Hello edonbajrami,

 

For multiple elements hover effects mimicking jQuery stop(true,false) with GSAP:, i believe the play() and reverse() approach works best:

 

My example:

See the Pen itmeB by jonathan (@jonathan) on CodePen

 

The above example was an approach inspired from

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

.

 

I hope this helps! :)

  • Like 2
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.
×