Results 1 to 3 of 3

Thread: Combo Box Viewer - dropdown mod

  1. #1
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Combo Box Viewer - dropdown mod

    1) Script Title: Combo Box Viewer

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...omboviewer.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

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Use this script instead:
    Code:
    <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.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. The Following User Says Thank You to rangana For This Useful Post:

    Orinovo (08-09-2008)

  4. #3
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Thumbs up

    Great!, Thanks rangana.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •