Chuprin
Chuprin

Reputation: 1137

Creating object in RaphaelJS

Is it possible to create Raphael's object but not drawing it on paper?

In example, i want to create circle, do some actions and show it on callback of actions.

Upvotes: 0

Views: 423

Answers (2)

Karmanya Aggarwal
Karmanya Aggarwal

Reputation: 548

You can use this construct:

var foo = circle(whatever).hide();

and then later use foo.show();

inside whichever callback. it creates the circle object (you can see it in the dom) but you won't see it on the raphael paper

Upvotes: 0

Otto Allmendinger
Otto Allmendinger

Reputation: 28268

You would need what is called an "offscreen canvas", something that is currently not implemented in html5 (some people talk about it).

Maybe you can create a canvas and set the css to display: none or visibility: hidden, and copy the image data from one canvas to the other.

Upvotes: 1

Related Questions