IE 7 fadeIn and fadeOut problems
Hello all,
Im new to jQuery but thought it would be nice to "pimp" my css menu with it. Now I have a fade-in when you hover over the menu and a fade-out when you move of the menu.
Everything works like a charm in Firefox, Opera, Apple Safari and IE6 (just need to edit the stylesheet a bit for IE 6) the only one who isnt cooperating is IE 7. The problem: IE 7 doesnt do a fade at all... It waits the 600 miliseconds and then the menu comes, just like it was with css only.
Is there anybody who knows what I'm doing wrong?
This is my html:
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<meta name="description" content="">
<meta name="keywords" content="">
<link rel="stylesheet"type="text/css" href="/css/menu2.css">
<script type="text/javascript" src="scripts/jquery-1.2.3.min.js"></script>
<script type="text/javascript" src="scripts/menu.js"></script>
</head>
<body>
<div id="wrapper">
<div class="menu">
<ul id="nav">
<li><a href="../menu/index.html">Menu</a>
<!--[if IE]><table><tr><td><![endif]-->
<ul id="test">
<li id="home"><a href="../menu/zero_dollars.html">Home</a></li>
<li id="om"><a href="../menu/embed.html">Over Mij</a></li>
<li id="contact"><a href="../menu/nodots.html">Contact</a></li>
<li id="port"><a href="../menu/nodo.html">Portfolio</a></li>
<li id="av"><a href="../menu/nodot.html">Algemene voorwaarden</a></li>
</ul>
</li>
<!--[if IE]></td></tr></table><![endif]-->
</ul>
</div>
</div>
</body>
</html>
This the menu.js
-
$(document).ready(function() {
$(" .menu ul ul ").css({display: "none"}); // Opera Fix
$(" .menu li").hover(function(){
$(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(600);
},function(){
$(this).find('ul:first').css({visibility: "visible"}).fadeOut(600);
});
});
CSS:
-
/* ================================================================
This copyright notice must be untouched at all times.
The original version of this stylesheet and the associated (x)html
is available at http://www.cssplay.co.uk/menus/final_drop.html
Copyright (c) 2005-2008 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any
way to fit your requirements.
=================================================================== */
body
{
background-color: #000;
}
#home a:hover
{
background-color: #9d5453;
}
#om a:hover
{
background-color: #b17675;
}
#contact a:hover
{
background-color: #c49898;
}
#port a:hover
{
background-color: #d8bbba;
}
#av a:hover
{
background-color: #ebdddd;
}
.menu {width:149px; height:32px; position:relative; z-index:100; font-family:arial, sans-serif;}
/* hack to correct IE5.5 faulty box model */
* html .menu {width:149px; w\idth:138px;}
/* remove all the bullets, borders and padding from the default list styling */
.menu ul {padding:0;margin:0;list-style-type:none;}
.menu ul ul {width:150px;}
/* float the list to make it horizontal and a relative positon so that you can control the dropdown menu positon */
.menu li {float:left;width:149px;position:relative;}
/* style the links for the top level */
.menu a, .menu a:visited {background: #fff url(/images/pijl.jpg) no-repeat top right; display: block; width: 150px; height: 25px; border: 1px solid black; line-height: 25px; text-decoration: none; color: #000; font-family: verdana; font-size: 80%; padding-left: 10px; font-weight: bold;}
/* TOT HIER GEEN PROBLEMEN */
/* a hack so that IE5.5 faulty box model is corrected */
* html .menu a, * html .menu a:visited {width:149px; w\idth:138px;}
/* hide the sub levels and give them a positon absolute so that they take up no room */
.menu ul ul {visibility:visible;display:none;position:absolute;height:0;top:27px;left:0; width:150px;}
/* TOT HIER GEEN PROBLEMEN */
/* another hack for IE5.5 */
* html .menu ul ul {top:30px;t\op:31px;}
/* style the table so that it takes no ppart in the layout - required for IE to work */
.menu table {position:absolute; top:0; left:0; border-collapse:collapse;;}
/* TOT HIER GEEN PROBLEMEN */
/* style the second level links */
.menu ul ul a, .menu ul ul a:visited {background: #fff;display:block; width: 150px; height: 25px; border: 1px solid black; line-height: 25px; text-decoration: none; color: #000; font-family: verdana; font-size: 70%; font-weight: normal; border-width:0px 1px 1px 1px;}
/* yet another hack for IE5.5 */
* html .menu ul ul a, * html .menu ul ul a:visited {width:150px;w\idth:128px;}
/* TOT HIER GEEN PROBLEMEN */
/* style the top level hover */
.menu a:hover /* .menu ul ul a:hover */ {color:#000; background-position: bottom right;}
.menu :hover > a /*, .menu ul ul :hover > a */ {color:#000; background-position: bottom right;}
/* TOT HIER GEEN PROBLEMEN */
/* make the second level visible when hover on first level list OR link */
.menu ul li:hover ul,
.menu ul a:hover ul{visibility:visible; }
/* TOT HIER GEEN PROBLEMEN */
/* keep the third level hidden when you hover on first level list OR link */
.menu ul :hover ul ul{visibility:hidden;}
/* make the third level visible when you hover over second level list OR link */
.menu ul :hover ul :hover ul{ visibility:visible;}
#wrapper
{
height: auto;
width: 149px;
margin: 0 auto;
}
Working?? example
Thanks in advance,
tornz0r