HTC的入门实例(原创)

test.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test</title>
<style type="text/css">
<!--
div 
{ behavior:url('test.htc')}
-->
</style>
</head>

<body>
<div align="left" Text="bbbbbb" onMouseOver="Hill()">test</div>
</body>
</html>

test.htc
<public:attach event="onclick" onevent="fun()" />
<public:property name="Text" get="GetText" put="SetText" />
<public:method name="Hill" internalname="f_Hill" />

<script language="JavaScript" type="text/javascript">
function fun()
{
alert(Text);
}


function GetText()
{
    
return element.innerHTML;
}


function SetText(value)
{
    element.innerHTML
=value;
}


function f_Hill()
{
    element.style.fontSize
="24px";
}


element.style.color
="#FF0000";
element.style.fontSize
="12px";
</script>
posted @ 2004-08-06 10:14  魔豆  阅读(653)  评论(0编辑  收藏  举报