vml-test2.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <html>
  2. <!--style>v\:*{behavior:url(#default#VML);position:absolute}</style-->
  3. <body>
  4. <!--v:oval style="left:0;top:0;width:100;height:50" fillcolor="blue" stroked="f"/-->
  5. <!--rvml:oval style="left:200;top:200;width:100;height:50" fillcolor="#456" stroked="f" class="rvml"/-->
  6. <!--v:shape style="POSITION: absolute; WIDTH: 10px; HEIGHT: 10px" coordsize = "100,100" filled = "false" stroked = "true" strokecolor = "#646464" strokeweight = "12.75pt" path = " m5733,1495 c5833,-5,-5,3175,95,1675 e"-->
  7. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
  8. <script type="text/javascript">
  9. $(function() {
  10. document.createStyleSheet().addRule(".jsplumb_vml", "behavior:url(#default#VML);border:1px solid red;position:absolute;");
  11. document.namespaces.add("jsplumb", "urn:schemas-microsoft-com:vml");
  12. // document.createStyleSheet().addRule("v\:*", "behavior:url(#default#VML)");
  13. var node = function(name, left, top, width, height, atts) {
  14. var o = document.createElement("jsplumb:" + name);
  15. o.className = "jsplumb_vml";
  16. o.style.left= left + "px";
  17. o.style.top = top + "px";
  18. o.style.width= width + "px";
  19. o.style.height= height + "px";
  20. for (var i in atts)
  21. o.setAttribute(i, atts[i]);
  22. document.body.appendChild(o);
  23. };
  24. node("oval", 0, 0, 100, 50, {"fillcolor":"blue", "filled":"true", "strokecolor":"red", "stroked":"true"});
  25. node("shape", 100,100, 700,645, {"coordsize":"700,645","filled":"false", "stroked":"true", "strokecolor":"#636363","strokeweight":"12.75pt",
  26. "path":"m0.0 c50,450,650,245,700,645"});
  27. // "path":" m5733,1495 c5833,-5,-5,3175,95,1675 e"});
  28. //"path":" m573,149 c583,-5,-5,317,95,167 e"});
  29. //"path":"m0,0 c583,-5,-5,317,500,500 e"});
  30. // "path":"m635.9999,150 c645.99998,0,0,291.8000,10,141.8000 e"});
  31. //"path":"m935.9999847412109,150 c945.9999847412109,0,0,291.8000030517578,10,141.8000030517578 e"});
  32. $(".jsplumb_vml").bind("click", function() {
  33. alert($(this).outerWidth() + "," + $(this).outerHeight());
  34. });
  35. });
  36. </script>
  37. </body>
  38. </html>