No replies
mattbaehr
mattbaehr's picture
Offline
newbie
Last seen: 12 years 42 weeks ago
Timezone: GMT-4
Joined: 2010-04-17
Posts: 1
Points: 2

I am using a script from Dynamic Drive and have posted this on their forum as well, with no luck. The script looks great in every browser but IE. When you hover over the parent page and the child pages show up, they go away when you start to scroll down. Any idea of a fix?

Both the CSS and the script are below. The site is http://www.computerdepot-online.net/

.vertmenu ul{
margin: 0;
padding: 0;
list-style-type: none;
font: bold 15px Verdana;
width: 220px; /* Main Menu Item widths */
}
 
.vertmenu ul li{
position: relative;
}
 
/* Top level menu links style */
.vertmenu ul li a{
display: block;
overflow: auto; /*force hasLayout in IE7 */
color: white;
text-decoration: none;
padding: 5px;
border-bottom: 1px solid #fff;
border-right: 1px solid #fff;
}
 
.vertmenu ul li a:link, .vertmenu ul li a:visited, .vertmenu ul li a:active{
background-color: #3266cc; /*background of tabs (default state)*/
}
 
.vertmenu ul li a:visited{
color: white;
}
 
.vertmenu ul li a:hover{
background-color: #7c1d1d;
}
 
/*Sub level menu items */
.vertmenu ul li ul{
position: absolute;
width: 220px; /*Sub Menu Items width */
top: 0;
visibility: hidden;
}
 
.vertmenu a.subfolderstyle{
background: url(right.gif) no-repeat 97% 50%;
}
 
 
/* Holly Hack for IE \*/
* html .vertmenu ul li { float: left; height: 1%; }
* html .vertmenu ul li a { height: 1%; }
/* End */

//Nested Side Bar Menu (Mar 20th, 09)
//By Dynamic Drive: <a href="http://www.dynamicdrive.com/style/
 
var" rel="nofollow">http://www.dynamicdrive.com/style/
 
var</a> menuids=["sidebarmenu1"] //Enter id(<img src="https://csscreator.com/sites/all/modules/smileys/packs/Roving/drunk.png" title="Drunk" alt="Drunk" class="smiley-content" /> of each Side Bar Menu's main UL, separated by commas
 
function initsidebarmenu(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle"
  if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
   ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
  else //else if this is a sub level submenu (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.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
  for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
  ultags[t].style.visibility="visible"
  ultags[t].style.display="none"
  }
  }
}
 
if (window.addEventListener)
window.addEventListener("load", initsidebarmenu, false)
else if (window.attachEvent)
window.attachEvent("onload", initsidebarmenu)