12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <!doctype html>
- <html>
- <head>
- </head>
- <body>
- <a href="#">CLICK THIS</a>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
- <script type="text/javascript">
- $(function() {
- $("a").bind("click", function() {
- $("#path1").attr("d", "M935.9999847412109,150C945.9999847412109,0,0,291.8000030517578,10,141.8000030517578");
- });
- var ns = {
- svg:"http://www.w3.org/2000/svg",
- xhtml:"http://www.w3.org/1999/xhtml"
- };
- var svgNode = function(name, attributes) {
- var n = document.createElementNS(ns.svg, name);
- attributes = attributes || {};
- attributes["version"] = "1.1";
- attributes["xmnls"] = ns.xhtml;
- for (var i in attributes) {
- n.setAttribute(i, "" + attributes[i]);
- }
- return n;
- };
- var s = svgNode("svg", {
- height:700,
- width:645
- });
-
- s.appendChild(svgNode("path", {
- d:"M635.9999847412109,150C645.9999847412109,0,0,291.8000030517578,10,141.8000030517578",
- "stroke-width":15,
- "stroke":"blue",
- "fill":"none",
- id:"path1"
- }));
- s.appendChild(svgNode("path", {
- d:"M235.9999847412109,150L550,500",
- "stroke-width":15,
- "stroke":"red",
- "fill":"none",
- id:"path2"
- }));
- document.body.appendChild(s);
- });
- </script>
-
- </body>
- </html>
|