EDIT: The code and examples have been changed, see the progress below.
I'm working on a menu that uses Jquery to animate the display of the dropdown/flyout lists.
The idea is, to have a menu that works well without javascript but when it is enabled we can had a bit of flair with Jquery, adding a alternative stylesheet and some animation.
The problem is IE7 and my inability to solve the bug. I've put an example online where you can see the issue. In IE7 the flyout (second-level navigation) does not display when javascript is enabled.
I have test it in IE8 (compatibility mode) and IE7 standalone I haven't had the opportunity to test in a pure IE7, so if any of you guys have it could you have a try and let me know what happens?
Does anybody know what can be the problem?
Link to the files: uxte.com/test/menu/
Link to example: uxte.com/test/menu/dropdown_example.html
Jquery code below:
$( document ).ready (
function() {
$('head link#noscript').replaceWith('<link id="script" rel="stylesheet" href="script.css" type="text/css" />');
/*Menu effects*/
function showElement( element ) {
element.css({
'display' : 'block',
'opacity' : '0'
});
// animate opacity to full
element.stop().animate({opacity: 1},{
duration: 500
});
}
function hideElement( element ) {
// animate opacity to nil
element.stop().animate({opacity: 0},{
duration: 500,
complete: function (){
element.css({ 'display' : 'none' });
}
});
}
$( "div#menu ul li" ).hover (
function() {
var ul = $( this ).find( "ul:first" );
showElement( ul );
},
function() {
var ul = $( this ).find( "ul:first" );
hideElement( ul );
}
);
}
);