polyline你设置了id,然后通过objId.points="..."这样就可以,和DHTML编程一样
解决方案 »
- ie8下的鼠标移出事件
- 请高手仔细看看下面的代码 为什么点击第一行修改按钮的时候不能修改那
- <img src="123.gif">连接图片出来是x
- 如何批量替换页面中的某些字符串信息
- 请教:过年了,帮帮小弟的忙!用javascript怎样将xml文件导出成Excel(XP或者2003)?急!
- td高度的设置
- 怎样在打开IE的同时打开一个窗口(窗口不包括菜单、状态栏、常用工具、地址栏)
- 怎么做一个级联的下拉框,其第一第二级的选项都是jsp动态生成的?
- 我写了一个函数,功能是弹出一个新的窗体,帮忙看看
- jquery求一款图片集展示插件
- 请教一个关于表单检测的问题?
- 讨论: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>
谢谢你们!
有问题还得向你们多多请教!