日期:2009-07-08  浏览次数:20855 次

自定义的METHOD:
在"HTC"中建立的副程序,除了让HTC本身的处理程序使用,还可以加入<Public:method name="程序名称">

声明成自定义的"METHOD",让主程序的元件使用。见如下代码:
XMLlover.htc
<public:method name="change1()"/>
<Script language="vbscript">
pos=1
    sub change1()
    str="我是XMLlover我怕谁~~~"
    text1=space(20)+str
    element.value=mid(text1,pos)
    pos=pos+1
    if pos>len(text1) then pos=1
end sub
</script>

XMLlover.htm
<HTML>
<head>
    <title>XMLlover</title>
    <style>
    .type1 {behavior:url(XMLlover.htc)}
    </style>
    <script language="vbscript">
    sub start()
        window.setinterval "t1.change1",500
    end sub
    </script>
</head>

</body>
<input type="text" name="t1" size="24" class="type1" style="font-size:18">
<p>
<input type="button" name="b1" value="click me" onclick="start()">
</body>
</HTML>    
自定义的动画效果!!!