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

addBehavior Method

Internet Development Index

Attaches a behavior to the element.

Syntax

iID = object.addBehavior(sUrl)

Parameters

sUrl Required. String爐hat specifies one of the following values:
sValueLocation of the behavior, in URL format. The URL must be bounded by quotation marks, as illustrated in the code sample below.
#default#behaviorNameOne of the Microsoft® Internet Explorer?A HREF="../reference.html">default behaviors, identified by its behavior name.
#objIDThe ID attribute specified in an object tag for the binary implementation of a behavior.

Return Value

Returns an identifier that can be used later to detach the behavior from the element.

Remarks

This method, and the following remarks, apply only to attached behaviors, which are the original Dynamic HTML (DHTML) behaviors introduced in Internet Explorer 5. Element behaviors are a new feature in Internet Explorer 5.5 and cannot be added or removed from an element.

This method enables you to attach a behavior without using Cascading Style Sheets (CSS).

Unless the behavior specified in the addBehavior call is one of the default behaviors built into Internet Explorer, the addBehavior call causes Internet Explorer to download the behavior asynchronously, before the behavior is attached to the element.

Due to the asynchronous nature of the addBehavior method, its return value cannot be relied on to determine whether the behavior was successfully applied to the element. Waiting for the onreadystatechange event to fire and verifying that the readyState property of the element is set to complete ensure that the behavior is completely attached to the element, and that all the behavior's members are available for scripting. Otherwise, attempting to use any behavior-defined member before the behavior is attached to the element results in a scripting error indicating that the object does not support that particular member.

Note  A behavior attached to an element using the addBehavior method, or by applying the proposed CSS?A HREF="../properties/behavior_1.html">behavior attribute inline, is not automatically detached from the element when the element is removed from the document hierarchy. However, a behavior attached using a style rule defined in the document is detached automatically as the element is removed from the document tree.

Example

This example uses the addBehavior method to dynamically attach a behavior that implements a mouseover highlighting effect to all li elements on a page.

<SCRIPT LANGUAGE="JScript">
var collBehaviorID = new Array();
var collLI = new Array ();
var countLI = 0;
function attachBehavior()
{
collLI = document.all.tags ("LI");
countLI = collLI.length;
for (i=0; i < countLI; i++)
{
var iID = collLI[i].addBehavior ("hilite.htc");
if (iID)
collBehaviorID[i] = iID;
}
}
</SCRIPT>
:
//Click <A HREF="javascript:attachBehavior()">here</A>
//to add a highlighting effect as you hover over each item below.
:
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.

Standards Information

There is no public standard that applies to this method.

Applies To

A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, CUSTOM, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, HEAD, hn, HR, HTML, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, INS, ISINDEX, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, nextID, NOBR, NOFRAMES, NOSCRIPT, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, RT, RUBY, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, WBR, XML, XMP

See Also

removeBehavior, Introduction to DHTML Behaviors, Using DHTML Behaviors, About Element Behaviors, Using HTML Components to Implement DHTML Behaviors in Script
大竹县| 桐城市| 温宿县| 神池县| 西藏| 拉萨市| 乐山市| 嘉定区| 迁安市| 克什克腾旗| 广平县| 中方县| 宽甸| 桃源县| 涞源县| 宁武县| 乐亭县| 奎屯市| 保亭| 巴林左旗| 蓝山县| 隆尧县| 临洮县| 平凉市| 黔西| 海南省| 渭源县| 武宁县| 大埔县| 双桥区| 丁青县| 柳州市| 襄樊市| 连江县| 霍州市| 新蔡县| 桐乡市| 阳原县| 岱山县| 澳门| 永寿县|