Re: HTML select field where the OPTION text is of different colors [message #172774 is a reply to message #172769] |
Mon, 28 February 2011 16:57 |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma:
|
Senior Member |
|
|
venky_lb wrote:
> On Feb 28, 6:31 pm, "gemo...@gmail.com" <gemo...@gmail.com> wrote:
>> On Feb 28, 9:52 am, venky_lb <lb.ve...@gmail.com> wrote:
>>
>>> Hi
>>> Is it possible to have an HTML select field where the OPTION text is
>>> of different colors?
>>> <select>
>>> <option>Black_text (yellow_text)</option>
>>> </select>
>>> I tried using an CSS SPAN element to color the text but that doesn't
>>> seem to work.
>>> Any ideas?
>> It's impossible. The only one thing that you can try is to emulate
>> select/options by javascript, but it's not easy
>
> Hi,
> Thanks for Sharing Ideas!!!
> any references for select/options by javascript?
>
Write your ownn. You need to construct tables or a set of divs with
onclick() or onmouseover() events that actually cause the flyout, and
allow you to set a form variable depending on what has been onclicked()
ed. Then you can mark them hidden until the user clicks on a dummy
select box, and re-hide them if he clicks on a transparent layer that
covers the whole screen that lies 'underneath' them.
Its nasty because Old IE doesn't handle layers too well.
And also because old IE is a bitch to search at any speed, to identify
which elements you need to turn on and off.
(solved here by making a dynamically extended Javascript array of all
elements that are switched on, as they are switched on, and searching
just that).
My code is a bit too application specific to be useful here.
And belongs in a javascript group anyway.
> Cheers
|
|
|