raphael - Multiple Canvas in ScaleRaphael - circle in 2nd canvas appears in 1st -


i got started raphael, don't right make multiple canvases in scaleraphael
(i#m using make site after responsive > there alternatives that?

multiple scaleraphael canvases: http://jsfiddle.net/karo/gmyp5/13/
or full view: http://jsfiddle.net/karo/gmyp5/13/embedded/result/
strange thing happens here.
red circle should in 2nd div if in code eg. firebug in fullview see both svgs in inside why that?

do have idea me? kaor

my code: html

<div id="wrapper"> <div id="paper"></div> <br> <div id="paper2"></div> </div> 

javascript:

var paper = new scaleraphael("paper",200,200); var circle = paper.circle(100, 100, 60).attr({fill:'red'});   var paper2 = new scaleraphael("paper2",200,200); var circle2 = paper2.circle(50, 50, 30).attr({fill:'black'});   function resizepaper(){   var win = $(this);   paper.changesize(win.width(), win.height(), true, false);   paper2.changesize(win.width(), win.height(), true, false);  } resizepaper(); $(window).resize(resizepaper); 

css

#wrapper {     position:relative; } #paper {     background-color: lightgray;     width:100%;     height:200px;     position:relative!important; } #paper2 {     background-color: orange;     width:100%;     height:100px;     position:relative!important; } svg {     position:absolute!important;     top:0;     left:0; } 

scaleraphael supports 1 canvas. in code can see re-referencing first existing svggroup or vmlgroup element.

you not need scaleraphael doing. since version 2 raphael has included paper.setviewbox , included paper.setsize, already.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -