size - How to get the width of the paper canvas of the Raphael javascript library, which is defined with relative values? -


i playing raphael svg library , defined element holding raphael canvas

<div id="canvas_container"></div> 

and placed raphael canvas/paper inside :

paper = new raphael(document.getelementbyid('canvas_container'), '100%', '100%'); 

now absolute width/height of canvas. figured out how access canvas paper.canvas if try paper.canvas.width svganimatedlength element , not width.

i noticed when using chrome dev-tools , selecting paper.canvas in console mouse, proper absolute size appears in window selected element (the blue selection appearing in page when element selected in chrome dev console). how in code ?

you can use offsetwidth , offsetheight values of canvas object in order determine true dimensions of raphael canvas.

example: http://jsfiddle.net/g54pr/1/


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -