PDA

View Full Version : Combo Box Viewer - dropdown mod



Orinovo
08-08-2008, 05:02 PM
1) Script Title: Combo Box Viewer

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/comboviewer.htm

3) Describe problem: Can this script load with no description/dropdown initially seen and when selected the description/dropdown disappears after 'x' seconds, fades away or disappears when user focuses elsewhere.

I am trying to use this under a nav menu on site, it would provide information on paper sheet sizes. when the site loads I do not want it to show any dropdown/descriptions initially only for example "sheet sizes" in menu, when the user selects for example "imperial" in the menu the dropdown description would show 30" x 22" and this will eventually go-away rather than being persistant like it currently is.

Orinovo

rangana
08-09-2008, 02:16 AM
Use this script instead:


<script type="text/javascript">

/*
Combo-Box Viewer script- Created by and Dynamicdrive.com
Visit http://www.dynamicdrive.com/ for this script and more
This notice MUST stay intact for legal use
*/

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.dropcontent{display:none;}\n')
document.write('</style>\n')
}

function contractall(){
if (document.getElementById){
var inc=0
while (document.getElementById("dropmsg"+inc)){
document.getElementById("dropmsg"+inc).style.display="none"
inc++
}
}
}

function expandone(){
if (document.getElementById){
var selectedItem=document.dropmsgform.dropmsgoption.selectedIndex
contractall()
document.getElementById("dropmsg"+selectedItem).style.display="block";
setTimeout(function(){document.getElementById('dropmsg'+selectedItem).style.display='none'},5000);
}
}
</script>


It disappears at 5 seconds time. You might want to adjust it, by adjusting the highlighted.

Hope that helps.

Orinovo
08-09-2008, 12:06 PM
Great!, Thanks rangana.