Javascript onMouseOver and onMouseOut

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

Javascript onMouseOver and onMouseOut

Postposted on Mon Jul 28, 2003 3:37 am

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?
Windows XP - The 64-bit wannabe with a 32-bit graphics interface for 16-bit extensions to a 8-bit patch on a 4-bit operating system designed to run on a 2-bit processor by a company that can't stand 1-bit of competition
fc34
Minister of Gerbil Affairs
 
Posts: 2816
Joined: Wed May 08, 2002 8:39 am
Location: Somewhere

Postposted on Mon Jul 28, 2003 10:14 am

try this:

Code: Select all
<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
Image
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Postposted on Tue Jul 29, 2003 5:07 am

why all that code?

I realized that all i forgot to do was to add a ';return true' at the end of both lines. :oops:

Besides, i dont understand all the code that you just added.
Windows XP - The 64-bit wannabe with a 32-bit graphics interface for 16-bit extensions to a 8-bit patch on a 4-bit operating system designed to run on a 2-bit processor by a company that can't stand 1-bit of competition
fc34
Minister of Gerbil Affairs
 
Posts: 2816
Joined: Wed May 08, 2002 8:39 am
Location: Somewhere

Postposted on Tue Jul 29, 2003 7:46 am

You can add a lot of more effects when using stylesheets, I guess.

:)
Amiga 1200, 68020@28MHz, 4MB+2MB RAM, Conner 80MB harddrive
FubbHead
Grand Gerbil Poohbah
 
Posts: 3483
Joined: Mon Apr 08, 2002 9:04 pm
Location: Borås, Sweden

Postposted on Tue Jul 29, 2003 8:12 pm

LOL thanx anyways.
Windows XP - The 64-bit wannabe with a 32-bit graphics interface for 16-bit extensions to a 8-bit patch on a 4-bit operating system designed to run on a 2-bit processor by a company that can't stand 1-bit of competition
fc34
Minister of Gerbil Affairs
 
Posts: 2816
Joined: Wed May 08, 2002 8:39 am
Location: Somewhere


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 3 guests