Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html xmlns:svg="http://www.w3.org/2000/svg">
- <head>
- <script src="svgweb/src/svg.js" data-path="svgweb/src"></script>
- <script src="jquery/jquery-1.4.2.js"></script>
- </head>
- <body>
- <script type="image/svg+xml">
- <svg width="200" height="200">
- <rect x="25" y="25"
- id="myRect"
- rx="0.6" ry="0.6"
- width="150" height="150"
- fill="green"
- stroke="yellow" stroke-width="8"/>
- </svg>
- </script>
- <script>
- window.onsvgload = function() {
- $("svg rect").attr('fill','yellow');
- var pos;
- for(pos = 0; pos < 7; pos++){
- var rectel = document.createElementNS(svgns, "rect");
- var svgel = $("svg").get(0);
- svgel.appendChild(rectel);
- $(rectel).attr({
- "x":10 * pos,
- "y":25,
- "width":8,
- "height":8,
- "fill":"green",
- "stroke":"red"
- });
- /*
- rectel.setAttribute("x",10 * pos);
- rectel.setAttribute("y",25);
- rectel.setAttribute("width",8);
- rectel.setAttribute("height",8);
- rectel.setAttribute("fill","green");
- rectel.setAttribute("stroke","red");
- */
- }
- };
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement