<?xml version="1.0" encoding="UTF-8"?>
<component>
<implements type="Behavior">
<attach event="onmouseover" handler="over"/>
<layout>
Just a Behavior test
</layout>
</implements>
<public>
<method name="test"/>
<event name="onasfman"/>
</public>
<script language="Javascript">
function over()
{
test();
}
function test()
{
var oEvent = createEventObject();
oEvent.asfman = "customize property";
fireEvent("onasfman",oEvent);
}
</script>
</component>
html:
<html>
<head></head>
<body>
<div id="test" style="behavior:url(behavior2.sct);width:100px;height:100px;border:1px solid red;"></div>
<script>
document.getElementById("test").onasfman=function()
{
alert(event.asfman);
}
</script>
</body>
</html>
posted on 2007-11-14 16:49
汪杰 阅读(222)
评论(0) 编辑 收藏 引用 所属分类:
javascript