Jump to content
Search Community

gsap3 mouseleave and mousemove

qqignatqq test
Moderator Tag

Recommended Posts

overwrite is set to false in v3. You can set it to true or "auto". It was set to "auto" in v2.

 

gsap.defaults({
	overwrite: true
})

$('.kareta-b').mouseenter(function(event){
	gsap.to($('.kareta-b .pimg'), 1, {
	  x:"-27%",
	  y:"-18%",
    width:"331%",
	});
});


$('.kareta-b').mouseleave(function(){
  gsap.to($('.kareta-b .pimg'), 0.7, {
	  x:"-27%",
	  y:"23%",
   width:"185%",
    });
});

 

  • Like 3
Link to comment
Share on other sites

Thank you so much for the hint, but I'm not going to be able to use this option, because I also animate X and Y in addition to Scale when I move the mouse. In any case, thank you. I used your decision in another part of the code, it helped me a lot.

 

I have a question. Is there any way you can use it for the whole function "overwrite:true" and for a certain part "overwrite:false". I'm asking because I stopped working on this piece of code: https://jsfiddle.net/2b9fgxL0/ . Opacity doesn't work for some reason... If overwrite is removed, everything will be fine.

 

Link to comment
Share on other sites

13 hours ago, qqignatqq said:

I have a question. Is there any way you can use it for the whole function "overwrite:true" and for a certain part "overwrite:false". I'm asking because I stopped working on this piece of code: https://jsfiddle.net/2b9fgxL0/ . Opacity doesn't work for some reason... If overwrite is removed, everything will be fine.

 

Use auto.

 

gsap.defaults({
	overwrite: "auto"
})

 

  • 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.
×
×
  • Create New...