Grafische gevorderde |
|
Ik heb een dropdown menu gecreëerd dat in FF en Opera perfect werkt, maar in IE doet hij raar. Het pijltje knippert bij mouseover/mouseout. Bekijk het maar eens in beide FF en IE en je ziet het verschil wel. http://www.bladin.nl/AYC-E-Cards/
Ps. let niet op de rotzooi, ik heb het niet geordend.
// JavaScript Document
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
// JavaScript Document startList = function() { if (document.all&&document.getElementById) { navRoot = document.getElementById("nav"); for (i=0; i<navRoot.childNodes.length; i++) { node = navRoot.childNodes[i]; if (node.nodeName=="LI") { node.onmouseover=function() { this.className+=" over"; } node.onmouseout=function() { this.className=this.className.replace(" over", ""); } } } } } window.onload=startList;
* {
font-family: verdana;
color #000;
font-size: 11px;
}
.dropdown_button {
position: absolute;
top: 1px;
right: 0px;
background-image: url("gfx/dropdown_button.gif");
background-repeat: no-repeat;
border-right: 1px solid #f2d6d9;
border-left: 1px solid #f2d6d9;
width: 20px;
height: 18px;
cursor: pointer; /* IE Fix */
}
/* Blaat */
ul {
margin: 0;
padding: 0;
list-style: none;
width: 145px;
}
ul li {
position: relative;
}
li ul {
position: absolute;
left: 0px; /* Set 1px less than menu width */
top: 21px;
display: none;
width: 137px;
background-color: #fefdfd;
border: 1px solid #f2d6d9;
padding: 3px;
}
/* Styles for Menu Items */
ul li a.parent {
display: block;
text-decoration: none;
color: #000;
background-image: url("gfx/dropdown_back.gif");
background-repeat: repeat-x;
border: 1px solid #f2d6d9;
height: 14px;
padding: 2px;
}
ul li a.child {
display: block;
text-decoration: none;
color: #000;
background-color: #fefdfd;
border: 1px solid #fefdfd;
padding: 3px;
}
/* Fix IE. Hide from IE Mac \*/
* html ul li { float: left; height: 1%; }
* html ul li a { height: 1%; }
/* End */
ul li a.child:hover {
color: #a7272f;
background-color: #fcf6f7;
border: 1px solid #c9545f;
} /* Hover Styles */
li:hover ul, li.over ul { display: block; } /* The magic */
* { font-family: verdana; color #000; font-size: 11px; } .dropdown_button { position: absolute; top: 1px; right: 0px; background-image: url("gfx/dropdown_button.gif"); background-repeat: no-repeat; border-right: 1px solid #f2d6d9; border-left: 1px solid #f2d6d9; width: 20px; height: 18px; cursor: pointer; /* IE Fix */ } /* Blaat */ ul { margin: 0; padding: 0; list-style: none; width: 145px; } ul li { position: relative; } li ul { position: absolute; left: 0px; /* Set 1px less than menu width */ top: 21px; display: none; width: 137px; background-color: #fefdfd; border: 1px solid #f2d6d9; padding: 3px; } /* Styles for Menu Items */ ul li a.parent { display: block; text-decoration: none; color: #000; background-image: url("gfx/dropdown_back.gif"); background-repeat: repeat-x; border: 1px solid #f2d6d9; height: 14px; padding: 2px; } ul li a.child { display: block; text-decoration: none; color: #000; background-color: #fefdfd; border: 1px solid #fefdfd; padding: 3px; } /* Fix IE. Hide from IE Mac \*/ * html ul li { float: left; height: 1%; } * html ul li a { height: 1%; } /* End */ ul li a.child:hover { color: #a7272f; background-color: #fcf6f7; border: 1px solid #c9545f; } /* Hover Styles */ li:hover ul, li.over ul { display: block; } /* The magic */
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>AYCE Cards</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="javascript.js"></script>
</head>
<body>
<ul id="nav">
<li><a class="parent" href="#">Services<div class="dropdown_button"></div></a>
<ul>
<li><a class="child" href="#">Web Design</a></li>
<li><a class="child" href="#">Internet Marketing</a></li>
<li><a class="child" href="#">Hosting</a></li>
<li><a class="child" href="#">Domain Names</a></li>
<li><a class="child" href="#">Broadband</a></li>
</ul>
</li>
</ul>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>AYCE Cards</title> <link rel="stylesheet" href="style.css" type="text/css" /> <script type="text/javascript" src="javascript.js"></script> </head> <body> <ul id="nav"> <li><a class="parent" href="#">Services<div class="dropdown_button"></div></a> <ul> <li><a class="child" href="#">Web Design</a></li> <li><a class="child" href="#">Internet Marketing</a></li> <li><a class="child" href="#">Hosting</a></li> <li><a class="child" href="#">Domain Names</a></li> <li><a class="child" href="#">Broadband</a></li> </ul> </li> </ul> </body> </html>
|