Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Menu expanding during page load

I have created a mega menu in our application. During the page load, this menu expands all items and then collapses (to required design) after page-load. This expanding is taking place for fraction of seconds and looks wierd to client. I believe that it is a browser issue. What should be done to solve this?

Note: I am using CSS to design the menu and applied this CSS in my aspx page in .net application

like image 888
Srikanth Avatar asked May 03 '12 11:05

Srikanth


2 Answers

In Style Sheet, add

display:none

to your root of menu. here I assume it to be unordered list

This is how, your style will be

<ul id="menu" style="display:none">...</ul>

Add Javascript code in your page.

If you are using JQuery. Try this,

jQuery(document).ready(function(){

jQuery('ul#menu').css('display','block');

});

If it does not work, please provide more information in your question.

like image 179
Nagarajan Ganesh Avatar answered Nov 03 '22 01:11

Nagarajan Ganesh


Initially set the menu visibility:hidden and only after page load set it to visibility:visible

like image 42
Registered User Avatar answered Nov 03 '22 02:11

Registered User