polyline你设置了id,然后通过objId.points="..."这样就可以,和DHTML编程一样

解决方案 »

  1.   

    不行啊
    认不出对象
    document.poly1.points="212,2132 245,2429 278,2355";
    document.all('poly1').points=""
    都不行
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <title>Thinking in VML</title>
    <STYLE> v\:* { BEHAVIOR: url(#default#VML) }
    </STYLE>
    <script language="javascript">
        document.all('poly1').points="212,2132 245,2429 278,2355";
        //document.all("group1").poly1.points="212,2132 245,2429 278,2355";
        //poly1.points="212,2132,245,2429,278,2355,308";
    </script>
    </head>
    <body>
    <v:group id="group1" style="WIDTH: 500pt; HEIGHT: 300pt" coordsize="5000,3000">
    <v:line style="Z-INDEX: 8; POSITION: absolute" from="200,100" to="200,2800" strokeweight="1pt">
    <v:stroke startarrow="classic"></v:stroke>
    </v:line>
    <FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT>
    <v:line style="Z-INDEX: 8; POSITION: absolute" from="200,2800" to="4800,2800" strokeweight="1pt">
    <v:stroke endarrow="classic"></v:stroke>
    </v:line>
    <v:rect style="WIDTH: 4900px; HEIGHT: 3000px" coordsize="21600,21600" fillcolor="white"
    strokecolor="black">
    <v:shadow on="t" type="single" color="silver" offset="4pt,3pt">
    <FONT face="宋体"></FONT>
    </v:shadow>
    </v:rect>
    <v:polyline id="poly1" style="Z-INDEX: 9" filled="f" strokecolor="red" strokeweight="1.5pt">
    <FONT face="宋体"></FONT>
    </v:polyline>
    </v:group>
    </body>
    </html>
    我这就是不行,
    帮我看看,
    多谢了
      

  3.   

    这个问题我也遇到
    好象points这个属性不能写一样我做的一个东西就是因为这个问题而改用shape对象的path的
    http://expert.csdn.net/Expert/topic/2212/2212327.xml?temp=.8609278
      

  4.   

    Points AttributeNovember 9, 1999Defines a set of points that make up a polyline. Read/write IVgPoints.Applies ToPolyline Tag Syntax 
    <v: element points="expression">Script Syntax element.points="expression"expression=element.pointsResDefines a set of straight line segments that are composed of a series of points. If the parent is not a VML element, the default unit is a pixel (but in, cm, mm, pt, pc may also be specified). The default value is "0,0 10,10". Note that commas are not required, but they make for easier readability.VML Standard Attribute
      

  5.   

    你的问题是,
    你把脚本放在最上面了,
    下面的代码还没解析的时候就执行脚本,当然会出错.. <script language="javascript" for=window event=onload>
        document.all('poly1').points="212,2132 245,2429 278,2355";
        //document.all("group1").poly1.points="212,2132 245,2429 278,2355";
        //poly1.points="212,2132,245,2429,278,2355,308";
    </script>就可以了
      

  6.   

    这个我知道了,确实位置放错了,,如何给Points赋值,???如何将原来polyline里面画的线擦掉??????望美洲豹及各位高高手解答!!!我感激不尽!!!
      

  7.   

    document.all('poly1').points.value='0,0 800,900';这样就对了.
      

  8.   

    yonghengdizhen(IUnknown::AddRef())  这个家伙说得对
    用下面的代码就可以了,重新设置points.value就可以擦去原来的线<html xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <title>Thinking in VML</title>
    <STYLE> v\:* { BEHAVIOR: url(#default#VML) }
    </STYLE>
    <script language="javascript">
    function SetInfo(){
      poly1.points.value="212,2132 245,2429 278,2355"
    } </script>
    </head>
    <body onload="SetInfo()">
    <v:group id="group1" style="WIDTH: 500pt; HEIGHT: 300pt" coordsize="5000,3000">
    <v:line style="Z-INDEX: 8; POSITION: absolute" from="200,100" to="200,2800" strokeweight="1pt">
    <v:stroke startarrow="classic"></v:stroke>
    </v:line>
    <v:line style="Z-INDEX: 8; POSITION: absolute" from="200,2800" to="4800,2800" strokeweight="1pt">
    <v:stroke endarrow="classic"></v:stroke>
    </v:line>
    <v:rect style="WIDTH: 5000px; HEIGHT: 3000px"  fillcolor="white"
    strokecolor="black">
    <v:shadow on="t" type="single" color="silver" offset="4pt,3pt">

    </v:shadow>
    </v:rect>
    <v:polyline id="poly1"  style="Z-INDEX: 5" filled="f" strokecolor="red" strokeweight="1.5pt">

    </v:polyline>
    </v:group>

    </body>
    </html>
      

  9.   

    to liuruhong(蓝色街灯)   yonghengdizhen(IUnknown::AddRef())  linhaibo(美洲豹) 
    谢谢你们!
    有问题还得向你们多多请教!