Current location: Hot Scripts Forums » General Web Coding » JavaScript » menu Issues?

menu Issues?

 
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-10-07, 09:11 AM
benq benq is offline
Newbie Coder
 
Join Date: May 2006
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
menu Issues?

hello all

i got a small issue, i have just built this menu using another menu, i,m using some of the same elemnts, in firefox it works no probs but in IE 6 & 7 explorer i get this problem.

http://img183.imageshack.us/img183/4719/untitled1jd0.th.jpg

thats the orginal menu http://solardreamstudios.com/_img/le...dex-horiz.html

my code for the menu:

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="menu.css" />
</head>
<!--[if gte IE 5.5]>
<script language="JavaScript" src="javascripts/dhtml.js" type="text/javaScript"></script>
<![endif]-->
<body onload="navHover()">
<ul id="navmenu">
<!-- Report menubar item -->
<li id="sub_navmenu"><a href="#">Report &gt;</a>
  <ul>
	<li><a href="#">Semester 1 Modules &gt;</a>
	  <ul>
	  	<li><a href="#">Lecturor</a></li>
		<li><a href="#">Tutor</a></li>
		<li><a href="#">Lecturor &amp; Tutor</a></li>
	  </ul>
	</li>
	<li><a href="#">Semester 2 Modules &gt;</a>
	  <ul>
	  	<li><a href="#">Lecturor</a></li>
		<li><a href="#">Tutor</a></li>
		<li><a href="#">Lecturor &amp; Tutor</a></li>
	  </ul>
	</li>
  </ul>
</li>
<!-- Question menubar item -->
<li id="sub_navmenu"><a href="#">Questionaire &gt;</a>
  <ul>
	<li><a href="#">Questions</a></li>
	<li><a href="#">Answers</a></li>
  </ul>
</li>
<!-- Exams menubar item -->
<li id="sub_navmenu"><a href="#">Exams &gt;</a>
  <ul>
	<li><a href="#">Semester 1</a></li>
	<li><a href="#">Semester 2</a></li>
	<li><a href="#">Results</a></li>
  </ul>
</li>
<!-- Add Student menubar item -->
<li><a href="#">Add Student</a></li>

<!-- Admin menubar item-->
<li><a href="#">Admin</a></li>

<!-- Exit menubar item -->
<li><a href="#">Exit</a></li>

</ul>


</body>
</html>
CSS

Code:
/* Root = Horizontal, Secondary = Vertical */
ul#navmenu {
  margin: 0;
  border: 0 none;
  padding: 0;
  width: 500px; /*For KHTML*/
  list-style: none;
  height: 24px;
}

ul#navmenu li {
  margin: 0;
  border: 0 none;
  padding: 0;
  float: left; /*For Gecko*/
  display: inline;
  list-style: none;
  position: relative;
  height: 24px;
}

ul#navmenu ul {
  margin: 0;
  border: 0 none;
  padding: 0;
  width: 160px;
  list-style: none;
  display: none;
  position: absolute;
  top: 24px;
  left: 0;
}

ul#navmenu ul:after /*From IE 7 lack of compliance*/{
  clear: both;
  display: block;
  font: 1px/0px serif;
  content: ".";
  height: 0;
  visibility: hidden;
}

ul#navmenu ul li {
  width: 160px;
  float: left; /*For IE 7 lack of compliance*/
  display: block !important;
  display: inline; /*For IE*/
  background:#000099;
}

/* Root Menu */
ul#navmenu a {
  border: 1px solid #FFF;
  border-right-color: #CCC;
  border-bottom-color: #CCC;
  padding: 0 6px;
  float: none !important; /*For Opera*/
  float: left; /*For IE*/
  display: block;
  background: #EEE;
  color: #666;
  font: bold 10px/22px Verdana, Arial, Helvetica, sans-serif;
  text-decoration: none;
  height: auto !important;
  height: 1%; /*For IE*/
}

/* Root Menu Hover Persistence */
ul#navmenu a:hover,
ul#navmenu li:hover a,
ul#navmenu li.iehover a {
  background: #CCC;
  color: #FFF;
}

/* 2nd Menu */
ul#navmenu li:hover li a,
ul#navmenu li.iehover li a {
  float: none;
  background: #000099;
  color: #666;
}

/* 2nd Menu Hover Persistence */
ul#navmenu li:hover li a:hover,
ul#navmenu li:hover li:hover a,
ul#navmenu li.iehover li a:hover,
ul#navmenu li.iehover li.iehover a {
  background: #000099;
  color: #FFF;
}

/* 3rd Menu */
ul#navmenu li:hover li:hover li a,
ul#navmenu li.iehover li.iehover li a {
  background: #FF0000;
  color: #666;
}

/* 3rd Menu Hover Persistence */
ul#navmenu li:hover li:hover li a:hover,
ul#navmenu li:hover li:hover li:hover a,
ul#navmenu li.iehover li.iehover li a:hover,
ul#navmenu li.iehover li.iehover li.iehover a {
  background: #FF0000;
  color: #FFF;
}

/* 4th Menu */
ul#navmenu li:hover li:hover li:hover li a,
ul#navmenu li.iehover li.iehover li.iehover li a {
  background: #EEE;
  color: #666;
}

/* 4th Menu Hover */
ul#navmenu li:hover li:hover li:hover li a:hover,
ul#navmenu li.iehover li.iehover li.iehover li a:hover {
  background: #CCC;
  color: #FFF;
}

ul#navmenu ul ul,
ul#navmenu ul ul ul {
  display: none;
  position: absolute;
  top: 0;
  left: 160px;
}

/* Do Not Move - Must Come Before display:block for Gecko */
ul#navmenu li:hover ul ul,
ul#navmenu li:hover ul ul ul,
ul#navmenu li.iehover ul ul,
ul#navmenu li.iehover ul ul ul {
  display: none;
}

ul#navmenu li:hover ul,
ul#navmenu ul li:hover ul,
ul#navmenu ul ul li:hover ul,
ul#navmenu li.iehover ul,
ul#navmenu ul li.iehover ul,
ul#navmenu ul ul li.iehover ul {
  display: block;
}
JS

Code:
navHover = function() {
	var lis = document.getElementById("navmenu").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);
i have included the files as well, can some one tell me why explorer is doing this ACtiveX blocking?

Thanks
Attached Files
File Type: zip files.zip (1.9 KB, 39 views)

Last edited by Nico; 02-10-07 at 09:15 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Menu tobyjoiner CSS 3 12-11-06 02:45 PM
CSS - Menu Problem vivabensmith CSS 7 12-04-06 04:06 AM
Xml / Dom / Css Mark_SC.SE JavaScript 0 06-29-05 09:05 AM
Right Click Menu dwoody JavaScript 1 10-15-04 10:11 AM
Simple tree menu w/ html and js? zcorpan JavaScript 2 06-18-04 07:17 PM


All times are GMT -5. The time now is 06:51 PM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.