+ -
当前位置:首页 → 问答吧 → 不好意思,还是VML的问题!!!

不好意思,还是VML的问题!!!

时间:2003-02-18

来源:互联网

main.htm

<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<xml:namespace prefix="v"/>
<STYLE>
P.Chart
{
COLOR: black; FONT-FAMILY: "times"; FONT-SIZE: 8pt; POSITION: absolute; TEXT-ALIGN: right
}

v\:*
{
BEHAVIOR: url(#default#VML)
}
                </STYLE>
<script language="JavaScript">
function createPoint(x,y,v)
        {
        var strElement;
        var newPoint;
        strElement="<v:rect title='"+v+"' style='top:"+x+";left:"+y+"width:100;height:100;position:relative'></v:rect>";
        newPoint = document.createElement(strElement);
        VMLGroup.insertBefore(newPoint);
        }
</script>
</head>
<div id="VMLChart" style="left:60;position:relative;">
        <v:group id="VMLGroup" style="width:432pt;height:324pt;" coordsize="4320,3240">
                <!-- Paper is white with a simple drop-shadow -->
                <v:rect style='width:4320;height:3240' fillcolor="white">
                        <v:shadow on="true" offset="4pt,3pt" color="silver" />
                </v:rect>
        </v:group>
</div>
<iframe src="CreateVML.php>" name="VMLData" style="display:none"></iframe>
</body>
</html>


CreateVML.php

<html>
        <head>
        </head>
        <body>
        <script language="JavaScript">
        <?php
                $i=0;
                for ($i==0;$i<10;$i++)
                {
                        echo "parent.createPoint($i,$i,$i*100);";
                }
        ?>
        </script>               
        </body>
</html>

可我只能看到:一开始的Rect和Shadow,看不到后来加的
<v:rect title="1...10" style="left:1...10;top:1...10;width:100px;height:100px;position:relative"></v:rect>

请问这是怎么回事!!!

还有一开始的问题,能不能也麻烦各位
http://bbs.51js.com/viewthread.php?tid=223

谢谢!!!

[ 本贴由 LeoZ 于 2003-2-18 15:42 最后编辑 ]

作者: LeoZ   发布时间: 2003-02-18

偶不会 PHP

作者: bencalie   发布时间: 2003-02-19

CreateVML.php的作用就是调10次parent.createPoint
such like this:
parent.createPoint(1,1,100);
parent.createPoint(2,2,100);
........................................
parent.createPoint(10,10,1000);

我在main.htm的
function createPoint(x,y,v)
        {
        var strElement;
        var newPoint;
        strElement="<v:rect title='"+v+"' style='top:"+x+";left:"+y+"width:100;height:100;position:relative'></v:rect>";
        newPoint = document.createElement(strElement);
        VMLGroup.insertBefore(newPoint);
       alert(v);
        }
倒是能alert10次,可Element-strElement就是没有indert进VMLGroup???

这个例子是我从您给我的资料里拿来的!!!

还有,麻烦您一起帮我解决上个贴子里后面我提出的问题,好吗?

作者: LeoZ   发布时间: 2003-02-19

热门下载

更多