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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I make an option value BLINK?

Status
Not open for further replies.

SueSp

MIS
Jul 26, 2004
39
US
Can I make an item in a select blink or stand out somehow?

For example, suppose I want value2 below to blink or have a font of different color or something. How would I do this?

Thanks!

<SELECT name='whatever'>
<OPTION value=value1>stuff1</OPTION>
<OPTION value=value2>stuff2</OPTION>
<OPTION value=value3>stuff3</OPTION>
</SELECT>
 
This works for me in IE6:

Code:
<html>
<head>
<script>
function blinkOption()
{
 if(document.forms[0].whatever.options[1].text == "")
  document.forms[0].whatever.options[1].text = "stuff2";
 else
  document.forms[0].whatever.options[1].text = "";
 setTimeout("blinkOption()",500);
}
</script>
</head>
<body onload='blinkOption();'>
<form>
<SELECT name='whatever'>
<OPTION value=value1>stuff1</OPTION>
<OPTION value=value2>stuff2</OPTION>
<OPTION value=value3>stuff3</OPTION>
</SELECT>
</form>
</body>
</html>

When you click the drop-arrow to expand the drop-down list, the text "stuff2" blinks at 1/2 second (500 ms) intervals as determined by the setTimeout(...) call in the function blinkOption().

'hope that helps.

--Dave
 
It's like the 90's all over again ;-)

I would heartily recommend that you opt for using a different colour or font weight rather than making it blink.
There's a reason the <blink> tag is depracated.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top