我要达到的目的就是在输入门片数以后,点击确定,会自动的画竖线.假如门片数为2.那么就在方框的中点画一条竖直的线.假如门片数为3,那么就在方框的1/3和2/3的位置各画一条竖直的线.依此类推.这个线是在生成的矩形框累生成的.线的长度和生成的矩形框的高度是一样的.要求有坐标理论.谢谢..
<HTML xmlns:v>
<HEAD> <style> v\:*{behavior:url(#default#VML);} /*声明V为VML变量*/</style>
<script language="javascript">
function inputvalue()
{
var h,w;
h=document.getElementById("h").value;
w=document.getElementById("w").value;
document.getElementById("demo").style.width=parseInt(w);
document.getElementById("demo").style.height=parseInt(h);
//让画出来的图形默认位于整个大框的中心位置.
document.getElementById("demo").style.left=(parseInt(window.screen.width)/2-(w/2));
document.getElementById("demo").style.top=(parseInt(window.screen.height)/2-(h/2));
document.getElementById("demo").style.display="";//设置层为可见
}
</script>
</HEAD>
<BODY>
<B>第一个VML实例:</B><p>
高:<input type="text" id="h">
宽:<input type="text" id="w">
<input type="button" οnclick="inputvalue();" value="设置大小"><p>
门片数:<input type="text" id="m">
<input type="button" οnclick="drawvalue();" value="确定">
</div>
<v:group style= "width:400px;height:400px;position:relative; " CoordOrig= "100,100 " CoordSize= "2800,2800 "> </group>
</body>
</HTML>
<HTML xmlns:v>
<HEAD> <style> v\:*{behavior:url(#default#VML);} /*声明V为VML变量*/</style>
<script language="javascript">
function inputvalue()
{
var h,w;
h=document.getElementById("h").value;
w=document.getElementById("w").value;
document.getElementById("demo").style.width=parseInt(w);
document.getElementById("demo").style.height=parseInt(h);
//让画出来的图形默认位于整个大框的中心位置.
document.getElementById("demo").style.left=(parseInt(window.screen.width)/2-(w/2));
document.getElementById("demo").style.top=(parseInt(window.screen.height)/2-(h/2));
document.getElementById("demo").style.display="";//设置层为可见
}
</script>
</HEAD>
<BODY>
<B>第一个VML实例:</B><p>
高:<input type="text" id="h">
宽:<input type="text" id="w">
<input type="button" οnclick="inputvalue();" value="设置大小"><p>
门片数:<input type="text" id="m">
<input type="button" οnclick="drawvalue();" value="确定">
</div>
<v:group style= "width:400px;height:400px;position:relative; " CoordOrig= "100,100 " CoordSize= "2800,2800 "> </group>
</body>
</HTML>