Hi,
I have a menu and if you hover over the headings it shows an inline sub menu. The problem I have is that the page loads and for a second shows the full menu with all the subs before hiding the subs and just showing the top navigation headings.
I have tried
.css ('visibility', 'hidden')
$.('.ul').css('visibility', 'hidden')
$('.topnav > li > ul').hide();
I have added and removed visibility:hidden; from the style sheet relating to this ul.
I am completely out of ideas but it looks really messy having everything showing for that second.
Here is my code:
Code:
$('.topnav > li > ul').css('display', 'none');
$('.topnav > li').bind('mouseover', openSubMenu);
$('.topnav > li').bind('mouseout', closeSubMenu);
function openSubMenu(){
$(this).find('ul').css('display', 'block');
};
function closeSubMenu(){
$(this).find('ul').css('display', 'none');
};