Colorful Object onMouseOver | JavaScriptSource

Colorful Object onMouseOver

Thai Phong Oct 31, 2005

General

This script makes it easy to highlight different areas of your page. The colors are chosen at random. Move your mouse over the areas below.


Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.


You can use this script for many objects as table:

   
   

Notes

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: colorfulObjectOnmouseover.js


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(3 comments)

The problem with this script is it sets the background colour to transparent, so if you do have the background attribute set to anything this script will wipe it out. I've edited the script to correct that[br /][br /]		var oldColours = new Array()[br /][br /]		function highlightTR(item)[br /]		{[br /]			oldColours[this] = item.style.backgroundColor;[br /]			item.style.backgroundColor="#00CCFF";[br /]		}[br /]		function returnTR(item)[br /]		{[br /]			item.style.backgroundColor=oldColours[this];[br /]		}

RandomInsano Sep 11, 2007

It's working now. Just don't use a link with the DOCTYPE.

Lee May 15, 2007

This doesn't work in Gecko Browsers (e.g. Firefox) :-(

Adam Feb 16, 2007