最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

PUBLIC:ATTACH Element

Internet Development Index

Binds a function to an event, so that the function is called whenever the event fires on the specified object.

Syntax

<PUBLIC:ATTACH
    EVENT = "sEvent"
    FOR = "sObject"
    ID = "sID"
    ONEVENT = "sEventHandler"
/>

Attributes

EVENT
Required. String that specifies the name of a Dynamic HTML (DHTML) event, or any of the events specific to the HTML Component (HTC) that are listed in the HTC Reference.
FOR
Optional. String that specifies one of the following values to identify the source of the event.
documentRefers to the document object.
elementDefault. Refers to the element to which the behavior is attached.
windowRefers to the window object.
ID
Optional. String that uniquely identifies the PUBLIC:ATTACH element within the component. This attribute is analogous to the ID attribute in DHTML.
ONEVENT
Required. String that specifies an inline script or a direct invocation of the event handler function.

Element Information

Parent elementsPUBLIC:COMPONENT
Child elements None
Minimum availabilityInternet Explorer 5
Minimum operating systems Windows 95, Windows NT 4.0

Remarks

The PUBLIC:ATTACH element is a declarative form of the attachEvent method.

When the specified event fires on the element to which the behavior is attached, the element's event handler is called first, before the behavior's. If multiple behaviors are attached to an element and multiple event handlers are defined for the same event on the same element, the functions are called in random order, immediately after the element's event handler is called.

When providing a value for ONEVENT, avoid assigning the event handler function the name of an existing DHTML event. Using an existing DHTML event name might cause recursion errors.

Event names are case-sensitive for all scripted languages.

Example

This example uses an HTC to implement a table of contents that expands and collapses. The HTC attaches to the element's onclick event, and then expands or collapses the list each time the onclick event is received.

<PUBLIC:PROPERTY NAME="child" />
<PUBLIC:ATTACH EVENT="onclick" ONEVENT="ExpandCollapse()" />
<SCRIPT LANGUAGE="JScript">
function ExpandCollapse()
{
var i;
var sDisplay;
// Determine current state of the list (expanded or collapsed)
// based on the current display property of the child.
bCollapsed = (element.document.all(child).style.display == "none");
if (bCollapsed)
{
style.listStyleImage = "url('../common/blueminus.gif')";
element.document.all(child).style.display = "";
}
else
{
style.listStyleImage = "url('../common/blueplus.gif')";
element.document.all(child).style.display = "none";
}
}
</SCRIPT>
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

See Also

Introduction to DHTML Behaviors, Using HTML Components to Implement DHTML Behaviors in Script
阿巴嘎旗| 德钦县| 深泽县| 珠海市| 仙桃市| 台中市| 德昌县| 叶城县| 泽普县| 赤水市| 钟山县| 师宗县| 蓬溪县| 米易县| 澄城县| 衡阳市| 竹溪县| 利津县| 贡山| 呈贡县| 武汉市| 如东县| 卓尼县| 镇康县| 永康市| 朝阳市| 佛教| 沙河市| 曲松县| 泰来县| 历史| 垦利县| 城固县| 巴林右旗| 华宁县| 霍山县| 福泉市| 衡南县| 临夏县| 建湖县| 修武县|