I've built a top menu based on superfish, but the amount of displayed items in the menu is huge. And there is also alot of jquery on the top menu. Now to the problem, everytime I load any page that has the menu, the browser(ie7) feels like it looks it locks it self for about 1-2 seconds while the page is being loaded. I'm sure that the top menu is the issue, and I would like to improve the performance of the page.(besides removing the menu and removing the menu items) I've used firebug to see which calls take most of the times, and I the calls are standard jquery or superfish. The top menu is a ascx control. Are they any good ways to let the page load first and the menu later or any other goods ideas to improve the performance?
Asked
Active
Viewed 107 times
1
-
There should be no reason for page initialization to take 1-2 seconds. There must be some inefficiencies throughout your code. @Robert Harvey's idea is a good one – David Murdoch Apr 21 '10 at 19:55
-
Probably there is too much js code running on the much and to much dom elements. I've tried to "cache" the dom elements while doing certain jquery. But it hasn't been enough to improve the performance now – Daniel Apr 22 '10 at 05:48
2 Answers
1
Have you tried moving all of your script code (Javascript, jQuery) to the bottom of the page, just before the </html>
tag?

Robert Harvey
- 178,213
- 47
- 333
- 501
-
I moved all the js that related to the top menu down before the
and it didnt seem to help at all, does it have to be between the end body and end of the html tag?
– Daniel Apr 22 '10 at 05:44 -
Before the `
` tag is fine, but you need to move *all* of it, not just the stuff related to the menu. The idea is to get the web page to (at least partially) render before the Javascript/jQuery executes.
– Robert Harvey Apr 22 '10 at 14:37
0
Have you ever considered loading the menu just once? We had the same kind of problem not long ago where the menu was being reloaded every time the page refresh.
What we did was we minimized page refreshes and force most of our pages to submit/retrieve data via $.ajax
.
We only refresh the page when it is absolutely necessary.

Rosdi Kasim
- 24,267
- 23
- 130
- 154
-
As it is now it would take to much time to develop the top menu to load just once :/ But good idea to the next time though – Daniel Apr 22 '10 at 05:47