Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Reply To: Menu is too much slow..with more than 200+ menu item.

Home Forums Older releases 0.9.x Menu is too much slow..with more than 200+ menu item. Reply To: Menu is too much slow..with more than 200+ menu item.

#2759
admin
Keymaster

The biggest issue on your page is that it’s really very heavy. I mean you’ve used so many scripts/features that even a simple CSS hover effect has a noticeable lag on my MacBook Pro (not one of the most recent models but still a very capable machine). So my first suggestion would be to try to reduce the number of client-side scripts you use or at least try to use them more responsibly by paying attention to the performance hit of every “feature” you add. Because it’s not really just the menu that feels slow on your page.

As for the SmartMenus plugin, one thing that I see is that you are using a modified version of the SmartMenus plugin (not the stock v0.9.7) where you have completely removed the showTimeout logic from the code. So I would suggest to replace it with the stock v0.9.7 and use the default showTimeout/hideTimeout options when initializing the script – i.e. replace this code:

jQuery('#main-menu').smartmenus({
	mainMenuSubOffsetX: 0,
	mainMenuSubOffsetY: 0,
	subMenusSubOffsetX: 1,
	subMenusSubOffsetY: -8,
	showTimeout: 0,
	hideTimeout: 0
});

with this:

jQuery('#main-menu').smartmenus({
	mainMenuSubOffsetX: 0,
	mainMenuSubOffsetY: 0,
	subMenusSubOffsetX: 1,
	subMenusSubOffsetY: -8
})

On theory this sounds as if you would add more lag before showing the sub menus but in reality it makes the script more responsive to cursor movement since the code that shows/hides the sub menus is not triggered immediately. Additionally, you may try setting the keepInViewport: false option which should reduce the calculations the script needs to do before displaying the sub menus but, of course, this is in case you can live without this feature.