Advertisement
Guest User

Cefn Hoile

a guest
Aug 7th, 2010
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.18 KB | None | 0 0
  1. <html xmlns:svg="http://www.w3.org/2000/svg">
  2.     <head>
  3.         <script src="svgweb/src/svg.js" data-path="svgweb/src"></script>
  4.         <script src="jquery/jquery-1.4.2.js"></script>
  5.     </head>
  6.     <body>
  7.         <script type="image/svg+xml">
  8.          <svg width="200" height="200">
  9.              <rect x="25" y="25"
  10.                    id="myRect"
  11.                    rx="0.6" ry="0.6"
  12.                    width="150" height="150"
  13.                    fill="green"
  14.                    stroke="yellow" stroke-width="8"/>
  15.          </svg>
  16.         </script>
  17.         <script>
  18.             window.onsvgload = function() {
  19.                 $("svg rect").attr('fill','yellow');
  20.                 var pos;
  21.                 for(pos = 0; pos < 7; pos++){
  22.                     var rectel = document.createElementNS(svgns, "rect");
  23.                     var svgel = $("svg").get(0);
  24.                     svgel.appendChild(rectel);
  25.                    
  26.                     $(rectel).attr({
  27.                         "x":10 * pos,
  28.                         "y":25,
  29.                         "width":8,
  30.                         "height":8,
  31.                         "fill":"green",
  32.                         "stroke":"red"
  33.                     });
  34.  
  35.                     /*
  36.                     rectel.setAttribute("x",10 * pos);
  37.                     rectel.setAttribute("y",25);
  38.                     rectel.setAttribute("width",8);
  39.                     rectel.setAttribute("height",8);
  40.                     rectel.setAttribute("fill","green");
  41.                     rectel.setAttribute("stroke","red");
  42.                     */
  43.                 }
  44.             };     
  45.         </script>
  46.     </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement