Results 1 to 8 of 8

Thread: SuckerTree Horizontal Menu, IE problem

  1. #1
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default SuckerTree Horizontal Menu, IE problem

    1) Script Title: SuckerTree Horizontal Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/style/cs...nu-horizontal/

    3) Describe problem: I really would want to use this menu for my own website, the problem is that it isnt really functioning like it should in IE

    Ive placed an online example of the menu

    http://www.crimeparadise.nl/voorbeeld/standaard2.php

    You will see that it wil work out fine in the Opera or Modzilla browser but in the IE browser there wil be an whitespace which is very annoying for the mouseover effect, because you will get out of the menu when your not fast enough

    Screenie


    The code from the file is (almost) exact the same as the given code the only thing ive changed is that i made an extra subitem after an folder

    Major Payne

  2. #2
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    please someone?

  3. #3
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    <ul>
    <li><a href="#">Sub Item 2.1</a></li>
    <li><a href="#">Folder 2.1</a>
    <ul>
    <li><a href="#">Sub Item 2.1.1</a></li>
    <li><a href="#">Sub Item 2.1.2</a></li>
    <li><a href="#">Sub Item 2.1.3</a></li>
    <li><a href="#">Sub Item 2.1.4</a></li>
    </ul>
    </li> <li><a href="#">Sub Item 2.2</a></li>


    take out the </li> shown above

  4. #4
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    that doesnt work

  5. #5
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Change the DD code to this:
    Code:
    <style type="text/css">
    
    /*Credits: Dynamic Drive CSS Library */
    /*URL: http://www.dynamicdrive.com/style/ */
    
    .suckertreemenu ul{
    margin: 0;
    padding: 0;
    list-style-type: none;
    }
    
    /*Top level list items*/
    .suckertreemenu ul li{
    position: relative;
    display: inline;
    float: left;
    background-color: #F3F3F3; /*overall menu background color*/
    line-height:0;
    }
    
    /*Top level menu link items style*/
    .suckertreemenu ul li a{
    display: block;
    width: 90px; /*Width of top level menu link items*/
    padding: 1px 8px;
    border: 1px solid black;
    border-left-width: 0;
    text-decoration: none;
    color: navy;
    }
    	
    /*1st sub level menu*/
    .suckertreemenu ul li ul{
    left: 0;
    position: absolute;
    top: 1em; /* no need to change, as true value set by script */
    display: block;
    visibility: hidden;
    }
    
    /*Sub level menu list items (undo style from Top level List Items)*/
    .suckertreemenu ul li ul li{
    display: list-item;
    float: none;
    line-height:0;
    }
    
    /*All subsequent sub menu levels offset after 1st level sub menu */
    .suckertreemenu ul li ul li ul{ 
    left: 159px; /* no need to change, as true value set by script */
    top: 0;
    }
    
    /* Sub level menu links style */
    .suckertreemenu ul li ul li a{
    display: block;
    width: 160px; /*width of sub menu levels*/
    color: navy;
    text-decoration: none;
    padding: 1px 5px;
    border: 1px solid #ccc;
    }
    
    .suckertreemenu ul li a:hover{
    background-color: black;
    color: white;
    }
    
    /*Background image for top level menu list links */
    .suckertreemenu .mainfoldericon{
    background: #F3F3F3 url(media/arrow-down.gif) no-repeat center right;
    }
    
    /*Background image for subsequent level menu list links */
    .suckertreemenu .subfoldericon{
    background: #F3F3F3 url(media/arrow-right.gif) no-repeat center right;
    }
    
    * html p#iepara{ /*For a paragraph (if any) that immediately follows suckertree menu, add 1em top spacing between the two in IE*/
    padding-top: 1em;
    }
    	
    /* Holly Hack for IE \*/
    * html .suckertreemenu ul li { float: left; height: 1&#37;; }
    * html .suckertreemenu ul li a { height: 1%; }
    /* End */
    
    </style>
    
    <script type="text/javascript">
    
    //SuckerTree Horizontal Menu (Sept 14th, 06)
    //By Dynamic Drive: http://www.dynamicdrive.com/style/
    
    var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas
    
    function buildsubmenus_horizontal(){
    for (var i=0; i<menuids.length; i++){
      var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
        for (var t=0; t<ultags.length; t++){
    		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
    			ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
    			ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
    		}
    		else{ //else if this is a sub level menu (ul)
    		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
        	ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
    		}
        ultags[t].parentNode.onmouseover=function(){
        this.getElementsByTagName("ul")[0].style.visibility="visible"
        }
        ultags[t].parentNode.onmouseout=function(){
        this.getElementsByTagName("ul")[0].style.visibility="hidden"
        }
        }
      }
    }
    
    if (window.addEventListener)
    window.addEventListener("load", buildsubmenus_horizontal, false)
    else if (window.attachEvent)
    window.attachEvent("onload", buildsubmenus_horizontal)
    
    </script>
    ...and see if that helps. Changes are highlighted.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  6. #6
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    no the menu will then get flatten (sorry I dont know how to say it rigth in English)

    You can see it in the current example

    http://www.crimeparadise.nl/voorbeeld/standaard2.php

  7. #7
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    someone

  8. #8
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    if someone's wondering whats the solution, just add

    Code:
    * html .suckertreemenu ul li ul li{ 
      float: left; height: 1%; 
    }
    * html .suckertreemenu ul li ul li a { 
      height: 1%; 
    }
    to the code

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
  •