[Beginner] Dropdown
[Beginner] Dropdown
Hello, I have this dropdown menu. But, it tends to jump a lot around and go crazy when I'm using IE! Can anyone help me with fixing this rather annoying error? It
looks like this in IE.
My code
dropdown.js
-
$(document).ready(function() {
$('ul#nav > li').hover(function() {
$('ul:first', this).slideToggle('fast');
},
function() {
$('ul:first', this).slideToggle('fast');
});
$('ul#nav li li').hover(function() {
$('ul:first', this).each(function() {
$(this).css('top', $(this).parent().position().top );
$(this).css('left', $(this).parent().position().left + $(this).parent().width() );
$(this).slideToggle('fast');
});
},
function() {
$('ul:first', this).hide();
});
});
style.css
-
ul#nav, ul#nav ul {
margin: 0px;
padding: 0px;
list-style: none;
display: block;
}
ul#nav ul {
padding: 10px 0px 0px 7px;
display: none;
position: absolute;
}
ul#nav li {
display: inline;
float: left;
text-indent: 0px;
margin: 0px;
}
ul#nav ul li a {
display: block;
text-decoration: none;
padding: 2px;
width: 120px;
color: #6AAEFE;
background: #E3F2FF;
}
ul#nav ul li a:hover {
color: #FFF;
background:#6CAFFE;
}
ul#nav li li {
display: block;
float: none;
}
Hopefully someone is able to help!
