...

View Full Version : Drop down works perfectly in Safari and Firefox but does nothing in IE



beedie
05-19-2009, 06:18 AM
What am I missing for IE? Nothing happens on the rollover.
HTML:

<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:

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

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.

beedie
05-19-2009, 06:57 AM
the menu is hiding behind the flash
How might I get it to go over the flash?

abduraooft
05-19-2009, 09:27 AM
See http://www.verticalmoon.com/tutorials/general/transparency/transparency.htm



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum