Navigation Menu

Site Contents
What's New?


Site FAQ
About JSS
JavaScript Forum
JavaScript Tutorial
Friends of JSS

Link to Us
JavaScript Help
Contribute a script
Technology Jobs

Become a Partner

Internet.commerce

Partner With Us
Dental Insurance
Best Price
Prepaid Phone Card
Memory Upgrades
Promos and Premiums
Computer Deals
Imprinted Gifts
Phone Cards
Logo Design
PDA Phones & Cases
Imprinted Promotions
Televisions
Business Liability
Web Design

Internet.com

IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Developer Channel

FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

Great Sites

DocJavaScript.com
dhtml.com
The Freebie Directory
TheFreeSite.com

Browse Doc JS's Tips!


Hiermenus Central


Promotions

Free Announcements


Social Bookmark

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


User Comments

Add a comment, suggestion, or correction
[For questions about usage, consult the Notes tab above or visit the JavaScript forum]

    
   
       
[optional field]
 
[optional field]

   

Comments feed Comment Feed RSS 2.0

3. From: RandomInsano
Returning colours back to normal
09/11/2007 15:38:18

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

var oldColours = new Array()

function highlightTR(item)
{
oldColours[this] = item.style.backgroundColor;
item.style.backgroundColor="#00CCFF";
}
function returnTR(item)
{
item.style.backgroundColor=oldColours[this];
}

1. From: Adam
02/17/2007 00:08:14

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

2. From: Lee (Admin)
05/15/2007 16:06:04

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


Do you write JavaScripts?
If you do, why not submit them to us?
We'll give you credit and a link back to your Web site.