This is a discussion on "[SOLVED] color-box selections" within the JavaScript Forum section. This forum, and the thread "[SOLVED] color-box selections are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] color-box selections
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] color-box selections
hi all,
I am trying to create a small block, consisting of color boxes. Roughly, my structure is something of the sort: <ul> <li><a href="#"></a></li> <li><a href="#"></a></li> ... <ul> I want to change the look of the <li>-s on mouse hover and do another change when a color box is clicked. the color set is dynamically obtained with .jsp and that's why I cannot just create a css class for every color box. Can you tell me a standard solution for such a problem. Do I have to change the background image of the <li> tag, or I'd better insert a <img> tag within the link. Do I have to use JavaScript for that? I tried to change the background attribute of the <li> using document.getElementById(li_id).style.background=". ..." but it didn't work. Thanks |
|
|
|
#2
|
|||
|
|||
|
Re: color-box selections
Try something like:
|
|
#3
|
|||
|
|||
|
Re: color-box selections
amazing, I tried all kinds of style.background / style.backgroundImage combinations, with all sorts of quotes - single, double and semicolons.
In the end the "winning combination" was: elem.style.backgroundImage = "url(images/image.gif)"; cheers. |
|
#4
|
||||
|
||||
|
Re: color-box selections
Could you please mark this as solved via thread tools! Thanks.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#5
|
|||
|
|||
|
Re: [SOLVED] color-box selections
hi
As I explained in the previous posts, I need a sequence of color boxes for a color selection. I implemented this as an unordered list and each <li> element has the corresponding color as a background picture. Onmouseover I change the background of the <li> with another picture, using: elem.style.backgroundImage = "url(images/image.gif)"; However, the images flicker and the user experience is therefore spoiled. Can you suggest another possible implementation for this purpose? Thanks! |
|
#6
|
||||
|
||||
|
Re: color-box selections
You can just use css for this..
Place links inside the li's and define some CSS
Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#7
|
|||
|
|||
|
Re: color-box selections
yup, you are right! I'll try it through css, thanks
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Links not the right color | MotorManiac | Web Page Design | 5 | Dec 9th, 2007 09:25 |
| [SOLVED] Change Input Textbox Background Color | tejaxx | JavaScript Forum | 4 | Nov 19th, 2007 20:16 |
| [SOLVED] Link Color and problem with Image positioning! | Ed | Web Page Design | 33 | Oct 10th, 2007 11:17 |
| [SOLVED] Zebra Row Color <DIV> | Monie | Web Page Design | 19 | Oct 10th, 2007 03:07 |
| selections within textareas | benbacardi | JavaScript Forum | 16 | Feb 16th, 2005 13:59 |