Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Hello and welcome to Raphael!</p> <p>I have been looking at Raphael for more than a few months and although the documentation is not very comprehensive the software is brilliant.</p> <p>I have been mixing Divs with Raphael objects in many ways and have got a "feel" for what works and what does not work.</p> <p>I am recommending that you do not try rotating divs but (instead) Raphael objects.</p> <p>First of all you could make a shiney set of Raphael buttons using this "tweakable" code below..</p> <pre class="lang-js prettyprint-override"><code>var bcontrols = new Array(); var yheight = 300; for (var i = 0; i &lt; 3; i++) { bcontrols[i] = paper.circle(15 + (35 * i), yheight, 15).attr({ fill: "r(.5,.9)#39c-#036", stroke: "none" }); bcontrols[i].shine = paper.ellipse(15 + (35 * i), yheight, 14, 14).attr({ fill: "r(.5,.1)#ccc-#ccc", stroke: "none", opacity: 0 }); bcontrols[i].index = i; bcontrols[i].shine.index = i; bcontrols[i].shine.mouseover(function (e) { this.insertBefore(bcontrols[this.index]); }); bcontrols[i].mouseout(function () { this.insertBefore(bcontrols[this.index].shine); }); /* Called from Raphael buttons */ bcontrols[i].click(function () { alert("Hello you just clicked " + this.index); }); } </code></pre> <p>Next you need to know more about rotating Sets:</p> <pre class="lang-js prettyprint-override"><code>var s = paper.set(); s.push(paper.rect(10, 10, 30, 30, 10).attr({fill:'red'})); s.push(paper.rect(50, 10, 30, 30, 5).attr({fill:'blue'})); s.push(paper.rect(90, 10, 30, 30).attr({fill:'orange'})); s.animate({rotation: "360 65 25"}, 2000); </code></pre> <p>This shows the degree of rotation and the centre of rotation of the "set" on the last line.</p> <p>My additional Raphael resources website which aims to supplement documentation (Amongst other things):</p> <p><a href="http://www.irunmywebsite.com/raphael/raphaelsource.html" rel="nofollow noreferrer">http://www.irunmywebsite.com/raphael/raphaelsource.html</a></p> <p>Heres where you can run the above 2 code examples without alteration:</p> <p><a href="http://raphaeljs.com/playground.html" rel="nofollow noreferrer">http://raphaeljs.com/playground.html</a></p> <p>I'm hoping this helped...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload