codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:

Changing the background color onMouseOver



This rather neat trick lets you change the background color when the user hovers over a link.

Hover over the links below to see what we are talking about:



The code to do this uses the onMouseOver event to check whether the user is hovering over the link, and the simply sets the document.bgColor to the new color value.

Note that you can also use hexadecimal color codes here with the same effect. Here's the code:

<a href="http//:www.codetoad.com" onMouseOver="document.bgColor='red';return true">Red</a>













Recent Forum Threads
• Re: Help Running VB script in Windows 2003
• ONUNLOAD
• Re: Insert Contents of .txt file into a .html page
• Re: Perl regular expression problem.
• Re: Problems in login using WWW::Mechanize
• searching for gd::graph guide
• Re: ARRAY OF HASHMAPS
• Adv. Regexp or Otherwise
• Adv. Regexp or Otherwise


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008