javascript - Scaling with animation using Raphael 2 - Stack Overflow

I have a set of path elements that I'm trying to scale with animation. Based on some demos I'

I have a set of path elements that I'm trying to scale with animation. Based on some demos I've seen this should be possible, but I'm having no luck.

I've tried the following:

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

I also attempted things like 'scale':[5, 5] based on some other samples I found. Neither of these of work.

The following does work, but no animation is involved:

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

I'm using version 2.0.1 of raphael. Any suggestions about how I can get this to work?

Edit: The discrepancy between examples and my tests are possibly due to the update to Raphael 2, I'm looking into these changes.

I have a set of path elements that I'm trying to scale with animation. Based on some demos I've seen this should be possible, but I'm having no luck.

I've tried the following:

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

I also attempted things like 'scale':[5, 5] based on some other samples I found. Neither of these of work.

The following does work, but no animation is involved:

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

I'm using version 2.0.1 of raphael. Any suggestions about how I can get this to work?

Edit: The discrepancy between examples and my tests are possibly due to the update to Raphael 2, I'm looking into these changes.

Share Improve this question edited Nov 28, 2011 at 6:23 oli asked Nov 28, 2011 at 6:17 olioli 3,5512 gold badges29 silver badges35 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Ok, got it going, it was due to updates with Raphael 2.

The following worked for me:

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

Thanks to this thread for helping me figure it out.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745088460a4610546.html

相关推荐

  • javascript - Scaling with animation using Raphael 2 - Stack Overflow

    I have a set of path elements that I'm trying to scale with animation. Based on some demos I'

    15小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信