C
Catherine Lynn Smith
I'm looking through the client side javascript reference and there's
some mighty useful information in here, but it is not very specific on
'reading' information from event handlers.
In the interest of streamlining my scripting, I was thinking I could
write multi-purpose functions to handle mouseOver and mouseOut events.
Thus far, I am manually passing if it is an Over or Out event, but it
occurs to me that there might be a way to read status of an event
somewhere. Alas, the web is so full of 'simple' mouseOver and
mouseOut handling, I have not as of yet refined a search enough to get
to the information I need.
I tried just doing a test against the element event [
if(elementObject.onmouseover) { doThis(); } ] but that does not seem
to work. What I am looking for is something like:
<a href="somedoc.htm" onMouseOver="mouseEvent(this);"
onMouseOut="mouseEvent(this);">some link text</a>
<SCRIPT language="javascript"><!--
function mouseEvent(elementObject) {
if(elementObject.onmouseover) { // or whatever syntax to test
doSomething();
} else if(elementObject.onmouseout) { // again, whatever...
doSomethingElse();
}
}
// --></SCRIPT>
Thanks in advance for any help!
Kathy Lynn
some mighty useful information in here, but it is not very specific on
'reading' information from event handlers.
In the interest of streamlining my scripting, I was thinking I could
write multi-purpose functions to handle mouseOver and mouseOut events.
Thus far, I am manually passing if it is an Over or Out event, but it
occurs to me that there might be a way to read status of an event
somewhere. Alas, the web is so full of 'simple' mouseOver and
mouseOut handling, I have not as of yet refined a search enough to get
to the information I need.
I tried just doing a test against the element event [
if(elementObject.onmouseover) { doThis(); } ] but that does not seem
to work. What I am looking for is something like:
<a href="somedoc.htm" onMouseOver="mouseEvent(this);"
onMouseOut="mouseEvent(this);">some link text</a>
<SCRIPT language="javascript"><!--
function mouseEvent(elementObject) {
if(elementObject.onmouseover) { // or whatever syntax to test
doSomething();
} else if(elementObject.onmouseout) { // again, whatever...
doSomethingElse();
}
}
// --></SCRIPT>
Thanks in advance for any help!
Kathy Lynn