F
F
Farrukh2016-07-19 19:35:09
JavaScript
Farrukh, 2016-07-19 19:35:09

Uniform up column animation on Raphael?

How to make the column grow up. Now the bottom right corner is moving along with the animation from left to right.
https://jsfiddle.net/kholmukhamedovme/m4q4Lmbr/

var paper = Raphael("paper", 500, 500);

var bar = paper.path(
    "M 100, 500" +
    "L 200, 450" +
    "L 300, 500" +
    "Z"
).animate({
    path:
        "M 100, 350" +
        "L 200, 300" +
        "L 300, 350" +
        "L 300, 500" +
        "L 100, 500" +
        "Z"
}, 1000).attr("fill", "green").attr("stroke", "none");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Zuev, 2016-07-19
Kholmukhamedov @kholmukhamedovme

Add this little hack

var bar = paper.path(
    "M 100, 500" +
    "L 200, 450" +
    "L 300, 500" + 
    "L 300, 500" + // эта строка
    "Z"
  )

https://jsfiddle.net/beyktkbp/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question