Animation Scaling Using Raphael 2

I have a set of path elements that I am trying to scale using animation. Based on some demos, I saw that this should be possible, but I was out of luck.

I tried the following:

set.mouseover(function() { this.toFront().animate({'fill':'green', 'scale':'5 5'}, 50); }); 

I also tried to do something like 'scale':[5, 5] based on some other patterns that I found. None of these works.

The following works, but the animation is not involved:

 set.mouseover(function() { this.scale(2, 2); }); 

I am using version 2.0.1 of raphael. Any suggestions on how I can make this work?

Change The discrepancy between the examples and my tests is probably due to the Raphael 2 update, I am studying these changes.

+4
source share
1 answer

Well, everything worked out, it was due to updates from Raphael 2.

The following worked for me:

  this.toFront().animate({'fill':'green', 'transform':"s2 2"}, 50); 

Thanks to this thread to help me figure it out.

+8
source

Source: https://habr.com/ru/post/1383376/


All Articles