Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

background color on text???

Status
Not open for further replies.

Albuckj2

Programmer
Jan 7, 2003
68
GB
Hi,

I have a list of letters (A-Z) that are used as links. This list is static at the top of the page, and when the user clicks one of them, and a frame below populates with information concerning that letter, I want that letter to have a bright yellow background, so it is clear what has been clicked.
Is there any way you can put a background color behind a individual piece of text? And I need this to be done with different letters as the user clicks different ones.

Thanks for any help in advance,

Alex.
 
You can specify an onclick event to do this, I'm thinking. background color can be specified using styles.

The trick is making sure you unselect the 25 letters you don't want. Basically, you're duplicating a tabbed layout here. If you're going to use all 26 letters, then I think you're going to have to uniquely identify each in the form. Ugh. Then, I suppose you would write a single js function that would set the background styles of all 26 buttons to "deactivated". Then, you write a unique onclick event for each letter. The first thing the event does is run the aforementioned function. Then it modifies the background color of the identified control of your choice. Again, ugh.

A semi-goofy suggestion is to build 26 GIF images, each a strip of letters with one highlighted.

Would you be comfortable having your framed content page headed by big versions of the letter?

Cheers,
[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top