srcElement, fromElement, toElement
6268 단어 element
,
srcElement (DHTML )
, onmouseover、onmouseout
fromElement、toElement
Top
?
srcElement Attribute | srcElement Property
--------------------------------------------------------------------------------
Retrieves the object that fired the event.
Syntax
HTML < srcElement = oObject ... >
Scripting event.srcElement [ = oObject ]
Possible Values
oObject Object hat specifies the event that fired.
The property is read/write. The property has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft?Internet Explorer 5. For more information, see Dynamic Properties.
Example
This example uses the srcElement property to retrieve the parent object, if needed, create the text range, move to the original object, and select the first word in the object.
<SCRIPT LANGUAGE="JScript">
function selectWord() {
var oSource = window.event.srcElement ;
if (!oSource.isTextEdit)
oSource = window.event.srcElement.parentTextEdit;
if (oSource != null) {
var oTextRange = oSource.createTextRange();
oTextRange.moveToElementText(window.event.srcElement);
oTextRange.collapse();
oTextRange.expand("word");
oTextRange.select();
}
}
</SCRIPT>
Top
?
fromElement Attribute | fromElement Property
--------------------------------------------------------------------------------
Retrieves the object the mouse pointer is exiting during the onmouseover and onmouseout events.
Syntax
HTML < fromElement = oObject ... >
Scripting event.fromElement [ = oObject ]
Possible Values
oObject Object that specifies or receives the previous location of the mouse pointer.
The property is read/write. The property has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft?Internet Explorer 5. For more information, see Dynamic Properties.
Example
In this example, the alert returns "mouse arrived" when the mouse pointer moves over the button.
<SCRIPT>
function testMouse(oObject) {
if(!oObject.contains(event.fromElement)) {
alert("mouse arrived");
}
}
</SCRIPT>
:
<BUTTON ID=oButton onmouseover="testMouse(this)">Mouse Over This.</BUTTON>
Top
?
toElement Attribute | toElement Property
--------------------------------------------------------------------------------
Retrieves a reference to the object to which the user is moving the mouse pointer.
Syntax
HTML < toElement = oObject ... >
Scripting event.toElement [ = oObject ]
Possible Values
oObject Object hat specifies the object being moved to by the mouse.
The property is read/write. The property has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft?Internet Explorer 5. For more information, see Dynamic Properties.
Example
This example uses the toElement property to display the tagName of the object to which the user moves the mouse pointer.
<SCRIPT>
function fnGetTo(){
spanTo.innerHTML=window.event.toElement.tagName;
}
</SCRIPT>
:
<SPAN onmouseout="fnGetTo()">
<P>Mouse Over This</P>
<P>toElement: <SPAN ID="spanTo"></SPAN></P>
</SPAN>
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
vue.js의 컴포넌트 컬렉션 "Element"를 사용하여 다중 선택을 구현합니다.멀티플 셀렉트란 간단하게 말하면 복수 선택 가능한 셀렉트 박스입니다. 의외로 고객이 요구하는 UI상 필요한 것이 많아, 지금까지도 몇번이나 요망에 응해 왔습니다. 대체로 jQuery의 멀티플 셀렉트를 사용하고 있었습...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.