Raphael how to get last path and last circle, if i have 2 elements in the paper?

Posted by 3gwebtrain on Stack Overflow See other posts from Stack Overflow or by 3gwebtrain
Published on 2012-11-22T04:53:10Z Indexed on 2012/11/22 22:59 UTC
Read the original article Hit count: 146

Filed under:
|

I need to find the last path or circle in a paper, in order to perform further calculations to draw more elements, and calling 'paper.bottom' only gets the last element. Is there any way to get shapes of specific types, e.g. bottom.path, bottom.circle or traverse for the n'th child?

I want to avoid using jQuery selectors, as i can't retrieve any properties from those.

An example of a paper populated with shapes:

var paper = Raphael('paper',500,500);
var c1 = paper.circle(100,100,50)
var p1 = paper.path("M10 20l70 0")
var c2 = paper.circle(200,100,50)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about raphael