Colorful Object onMouseOver
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
- Created by: Thai Cao Phong
- Web Site: http://www.JavaScriptBank.com
- Posted: October 31, 2005
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 /]		}
It's working now. Just don't use a link with the DOCTYPE.
This doesn't work in Gecko Browsers (e.g. Firefox) :-(