PDA

View Full Version : Expand selectbox



molendijk
03-20-2008, 02:03 PM
Does anybody know how to use javascript in order to expand a selectbox on mouseover (not on click)? (No manipulation with 'selectbox size =').
With 'expand' I mean: make the options visible.
Thanks,
Arie Molendijk.

Jas
03-25-2008, 03:05 AM
As far as I know, that is impossible :( But, this website (http://www.pseudocoder.com/archives/2006/09/18/a-custom-select-box/) shows an interesting concept that you might look into if you really need to do that. It creates a fake textbox with css. You can work with that to create what you're looking for. Other then that, I don't think it's possible.

Nile
03-25-2008, 03:09 AM
Well, it'll be simple to make your own...


function show(id){
document.getElementById(id).style.display="inline";
}
function close(id){
document.getElementById(id).style.display="none";
}

Then you'd just use the links and have like a span under each set of links with the style="display:none;", this way it'll show when hover if you put: onMouseOver and on onMouseOut, to hide, and display. You could also go in the menu part of Dynamicdrive on the homepage and change it from onClick to onMouseOver. I hope this helps. :)

molendijk
03-25-2008, 11:16 AM
Jas, thanks, I'll try that one.
Arie.

molendijk
03-25-2008, 11:20 AM
Nile, thanks, but that would only show and hide the top option of the selectbox. What I want is some javascript allowing me a box like this one (http://molendijk.110mb.com/selectboxCrossbrowser1/selectbox.html) to open on mouseover (mouse over 'this is a selectbox'), not on click.
Arie.