Detaches a behavior from the element. dhtml语法 bsuccess = object.removebehavior(iid)
parameters iID |
Required.
Integerthat specifies the identifier returned from a previous addbehavior call. |
return value returns one of the following possible values: true | the behavior was successfully removed. | false | the behavior was not removed. |
Remarks
This method applies only to attached behaviors, which are the original Dynamic HTML(动态HTML,即DHTML) behaviors introduced in Microsoft® Internet Explorer 5. Element behaviors are a new feature in Internet Explorer 5.5 and cannot be added or removed from an element.
DHTML代码范例
This example uses the removeBehavior method to show how a behavior that implements a mouseover highlighting effect can be dynamically removed from all li elements on a page. <script language="jscript">
var collBehaviorID = new Array();
var collLI = new Array ();
var countLI = 0;
:
function detachBehavior()
{
for (i=0; i < countLI; i++)
collLI[i].removeBehavior (collBehaviorID [i]);
}
</SCRIPT>
:
Click <A href="javascript:detachbehavior()">here</A>
to remove highlighting effect.
: 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.
是否符合公共标准
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 | |
更多语法参考 addbehavior, introduction to dhtml behaviors, using dhtml behaviors, about element behaviors, Implementing DHTML Behaviors in Script
|