polyline你设置了id,然后通过objId.points="..."这样就可以,和DHTML编程一样
解决方案 »
- js中函数递归调用,提示processHover,processLeave未定义
- 对javascript不熟悉,现在一个java小程序改成javascript,出现些问题,应该不难,好了就送分
- |zyciis| 为什么我的DIV显示隐藏在FireFix中可以,但在IE中不行呢 谢谢 在线
- IE7中window.open的问题
- applyElement与appendChild区别的问题?
- 在html页面中,如何捕获activeX控件的click消息
- 时间格式判断
- 梅雪香,请再给我解答一下,谢谢!
- 哪位大哥能介绍一下用javascript编写游戏的思路!
- 可拖动和停靠的表格如何实现的?
- 请教一个关于表单检测的问题?
- 讨论:JavaScript 如何关机?
认不出对象
document.poly1.points="212,2132 245,2429 278,2355";
document.all('poly1').points=""
都不行
<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>
我这就是不行,
帮我看看,
多谢了
好象points这个属性不能写一样我做的一个东西就是因为这个问题而改用shape对象的path的
http://expert.csdn.net/Expert/topic/2212/2212327.xml?temp=.8609278
<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
你把脚本放在最上面了,
下面的代码还没解析的时候就执行脚本,当然会出错.. <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>就可以了
用下面的代码就可以了,重新设置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>
谢谢你们!
有问题还得向你们多多请教!