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

Making a select box drop down on mouseover

Status
Not open for further replies.

zippynz

Programmer
May 17, 2001
50
0
0
NZ
hi,
is it possible to make a select box 'open' using a mouseover?
 
This is a very bizarre solution. It behaved sort of wierd in IE 5 and It didn't work at all in NS 6, but you might be able to work with a variation of it to meet your needs.

Otherwise, I can't think of any methods that you can apply to a select list to make it drop down other than clicking on it. The click() method doesn't work on this element type.

Copy this to a test page and run it.


<html>
<head>
<script Language=&quot;JavaScript&quot;>
<!--
function dropList(list_ref) {
list_ref.size = list_ref.length
}
function collapseList(list_ref) {
list_ref.size = 1
}
//-->
</script>
</head>
<body>
<form>
<select size=&quot;1&quot; name=&quot;mylist&quot; onMouseOver=&quot;dropList(this);&quot; onChange=&quot;collapseList(this);&quot;>
<option value=&quot;1&quot;>Option #1</option>
<option value=&quot;2&quot;>Option #2</option>
<option value=&quot;3&quot;>Option #3</option>
<option value=&quot;4&quot;>Option #4</option>
<option value=&quot;5&quot;>Option #5</option>
</select><br>
Other HTML Moves With It !!
</body>
</html>


ToddWW :)
 
thats actually has quite an interesting effect...
I may well use that on something else...

what I really wanted was to make the effect like when you normally just click on it

thanks anyway :)
 
OK, I forgot the closing </form> tag. But it still didn't work in NS 6.

ToddWW :)
 
Oh, that page I linked you to doesn't do a very good job of pointing you to the example. Scroll to the top of that page and move your mouse over one of the menus.

ToddWW :)
 
I think that kind of solution is getting a little to complicated (it is after all simply a form!!)

I think it might just be easier to click, but If you do come across something I would be very interested :)

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top