Page 1 of 1
Javascript onMouseOver and onMouseOut
Posted: Mon Jul 28, 2003 3:37 am
by fc34
Just wondering, these two commands dont seem to work anymore for me when using <a href></a>
For an example
<a href="http://www.website.com" onMouseOver="window.status='Click to see this site!'" onMouseOut="window.status=''">
It used to work for me but it dosent work now. Since I am a little out of date with HTML, is this feature disabled in the latest version of HTML?
Posted: Mon Jul 28, 2003 10:14 am
by thegleek
try this:
<html.... blah blah blah...>
<head>
<STYLE type="text/css">
.linkz { text-decoration: none;
background-color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 16pt;
font-weight : bold;
color: #000000 }
SPAN { cursor: hand; }
.onme { color: red; }
.offme { color: black; }
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
function getonme() {
el=event.srcElement; if (el.getAttribute("litUp1") != null) { el.className="onme"; }
}
function getoffme() {
el=event.srcElement; if (el.getAttribute("litUp1") != null) { el.className="offme"; }
}
document.onmouseover=getonme; document.onmouseout=getoffme;
</SCRIPT>
</head>
<body blah blah blah....>
<a href="http://www.website.com" class="linkz">
<SPAN TITLE="click to see this site!" litUp1>website.com</SPAN></a>
</body></html>
w00t
Posted: Tue Jul 29, 2003 5:07 am
by fc34
why all that code?
I realized that all i forgot to do was to add a ';return true' at the end of both lines.
Besides, i dont understand all the code that you just added.
Posted: Tue Jul 29, 2003 7:46 am
by FubbHead
You can add a lot of more effects when using stylesheets, I guess.
Posted: Tue Jul 29, 2003 8:12 pm
by fc34
LOL thanx anyways.