日期:2014-05-16  浏览次数:20301 次

用js操纵过vml的请帮忙,如何读写v:PolyLine的points?
直接用obj.points和用getAttribute、setAttribute都试过。。。

试验代码如下


<html   xmlns:v= "urn:schemas-microsoft-com:vml ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题文档 </title>
<STYLE>
v\:*   {   Behavior:   url(#default#VML)   }

</STYLE>
<script>
function   aa(){
var   obj=document.getElementById( "pc1-print2 ");
alert(obj.getAttribute( "points "));
alert(obj.points);
obj.setAttribute( "points ", "100,100   200,250   300,400   500,800 ",0);
// obj.points= "100,100   200,250   300,400   500,800 ";
}
</script>
</head>

<body>
<v:PolyLine   id= "pc1-print2 "   filled= "false "   points= "630,330   630,530   480,530 "   strokeweight= "1 "   style= "position:absolute;z-index:10; "   strokeColor= "blue "   fillcolor= "blue "> <v:TextBox   inset= "102px,200px,0px,0px "   style= "font-size:12px; "> 曲线 </v:TextBox> <v:stroke   EndArrow= "Classic "/> </v:PolyLine>
<input   type= "button "   name= "Submit "   value= "读写 "   onclick= "aa(); "/>
</body>
</html>


------解决方案--------------------
sofa
------解决方案--------------------
帮顶了。。。学习中
------解决方案--------------------
obj.points.value = "100,100 200,250 300,400 500,800 ";
------解决方案--------------------
帮顶了。。。学习中


------解决方案--------------------
去下载 美洲豹think in vml
里面介绍的蛮详细的