Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    88
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Drop down works perfectly in Safari and Firefox but does nothing in IE

    What am I missing for IE? Nothing happens on the rollover.
    HTML:
    Code:
    <tr>
    <td colspan="2" class="drop">
    <dl class="dropdown">
    <dt class="c1"><img src="images/gif/menubar_1.gif" alt="spacer"></dt>
    </dl>
    <dl class="dropdown">
    <dt id="two-ddheader" onmouseover="ddMenu('two',1)" onmouseout="ddMenu('two',-1)"><img src="images/gif/company.gif" alt="spacer"></dt>
    <dd id="two-ddcontent" onmouseover="cancelHide('two')" onmouseout="ddMenu('two',-1)">
    <ul>
    <li><a href="#" class="underline">Item 1</a></li>
    <li><a href="#" class="underline">Item 2</a></li>
    <li><a href="#" class="underline">Item 3</a></li>
    <li><a href="#" class="underline">Navigation Item 4</a></li>
    <li><a href="#">Navigation Item 5</a></li>
    </ul>
    </dd>
    </dl>
    CSS:
    Code:
    td.drop {margin:0; padding:0; border:0;white-space:nowrap;}
    .dropdown {float:left; margin:0; padding:0; border:0;white-space:nowrap;}
    .dropdown dl {margin:0; padding:0; border:0;white-space:nowrap;font-size:0; line-height:0}
    .dropdown dt {width:94px; height:23px; padding:0px; border:0px; margin:0px; font-weight:bold; cursor:pointer; white-space:nowrap;}
    /*.dropdown dt:hover {background:url(images/header_over.gif)}*/
    .dropdown dd {position:absolute; overflow:hidden; width:94px; display:none; background:#fff; z-index:200; padding:0px; border:0px; margin:0px;}
    .dropdown ul {width:94px;list-style:none; padding:0px; border:0px; margin:0px; white-space:nowrap;}
    .dropdown li {display:inline;padding:0px; border:0px; margin:0px;white-space:nowrap;}
    .dropdown a {display:block; padding:5px; color: #494748; text-decoration:none; text-align:left;background:#8d8b8c; width:200px; z-index:300;}
    .dropdown a:active, .dropdown a:visited {display:block; padding:5px; color: #494748; text-decoration:none; text-align:left;background:#8d8b8c; width:200px; z-index:300;}
    .dropdown a:hover {background:#494748; color:#000}
    Javascript file:
    I don't think this is the problem but in case
    Code:
    var DDSPEED = 15;
    var DDTIMER = 25;
    
    // main function to handle the mouse events //
    function ddMenu(id,d){
      var h = document.getElementById(id + '-ddheader');
      var c = document.getElementById(id + '-ddcontent');
      clearInterval(c.timer);
      if(d == 1){
        clearTimeout(h.timer);
        if(c.maxh && c.maxh <= c.offsetHeight){return}
        else if(!c.maxh){
          c.style.display = 'block';
          c.style.height = 'auto';
          c.maxh = c.offsetHeight;
          c.style.height = '0px';
        }
        c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
      }else{
        h.timer = setTimeout(function(){ddCollapse(c)},50);
      }
    }
    
    // collapse the menu //
    function ddCollapse(c){
      c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER);
    }
    
    // cancel the collapse if a user rolls over the dropdown //
    function cancelHide(id){
      var h = document.getElementById(id + '-ddheader');
      var c = document.getElementById(id + '-ddcontent');
      clearTimeout(h.timer);
      clearInterval(c.timer);
      if(c.offsetHeight < c.maxh){
        c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
      }
    }
    
    // incrementally expand/contract the dropdown and change the opacity //
    function ddSlide(c,d){
      var currh = c.offsetHeight;
      var dist;
      if(d == 1){
        dist = (Math.round((c.maxh - currh) / DDSPEED));
      }else{
        dist = (Math.round(currh / DDSPEED));
      }
      if(dist <= 1 && d == 1){
        dist = 1;
      }
      c.style.height = currh + (dist * d) + 'px';
      c.style.opacity = currh / c.maxh;
      c.style.filter = 'alpha(opacity=' + (currh * 100 / c.maxh) + ')';
      if((currh < 2 && d != 1) || (currh > (c.maxh - 2) && d == 1)){
        clearInterval(c.timer);
      }
    }
    Any suggestions much appreciated.

  • #2
    New Coder
    Join Date
    Mar 2008
    Posts
    88
    Thanks
    12
    Thanked 0 Times in 0 Posts
    the menu is hiding behind the flash
    How might I get it to go over the flash?

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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