| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

VML

Page history last edited by Corey Alix 14 years, 7 months ago

Avoid VML if possible. 

 

References:

http://sweatte.wordpress.com/syntax/xml-tips/vml-tips/

 

Bugs:

 

In this example the line will move down exponentially fast because of some undocumented reference point.  The only "workaround" I have is to set the top/left via a style and ensure there is at least one 0,0 point when creating the vector.  Setting coordorigin has no affect (values don't stick).

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns:v> <head> <title>VML Test</title> <?import namespace="v" implementation="#default#VML" ?> <style type="text/css"> vml\:* { behavior: url(#default#VML);display:inline-block } </style> <script type="text/jscript"> function DoIt() { // moves line down and right (IE8) when this is called the second time. var lvLine = document.getElementById("testline"); var lvValue = lvLine.points.value.toString(); window.status = lvValue; lvLine.points.value = lvLine.points.value; } </script> </head> <body> <input type="button" onclick="DoIt()" value="DoIt()" /> <v:polyline id="testline" points="100px,100px,100px,200px,200px,200px,200px,100px,100px,100px,0pt,1pt" style="position:absolute" filled="f" strokecolor="blue" /> </body> </html>

 

Possible Workaround (include a 0,0 point and translate every point):

 

<div style="position:absolute;top:0px;left:0px">

    <v:polyline id="original" points="100px,120px,100px,220px,200px,220px,200px,120px,100px,120px,0px,20px" style="position:absolute" filled="f" strokecolor="blue" />

    <v:polyline id="bugline" points="100px,120px,100px,220px,200px,220px,200px,120px,100px,120px,0px,20px" style="position:absolute" filled="f" strokecolor="blue" />

    <v:polyline id="workaroundline" points="100px,100px,100px,200px,200px,200px,200px,100px,100px,100px,0px,0px" style="position:absolute;top:20px" filled="f" strokecolor="yellow" />

</div>

 

Comments (0)

You don't have permission to comment on this page.