Mega menu loads after few seconds

Permalink Browser Info Environment
Hi There,

This is critical please!

We have installed the mega menu to the site and it loads after few seconds of the page load. Can you please let us know an update/advise on a solution?

Type: Discussion
Status: In Progress
ZyberLimited
View Replies:
jb1 replied on at Permalink Reply
jb1
The menu shows when all elements on the page have been loaded. So that means you have another element on the page slowing it down.

However, a quick workaround is to show the menu at an earlier stage.

Around line 267 or 300 of view.php (depending on the version of the block) in this block folder is the DOM event which triggers the display of the menu.

Rather than waiting for the page "onload" event to occur, you can use replace with this line of code:

Old:
$(function() {


New:
document.addEventListener("DOMContentLoaded", function(event) {


Hope this helps.

JB
ZyberLimited replied on at Permalink Reply
ZyberLimited
Hi JB,

Thanks for getting back to us! :)

Unfortunately it didn't work :( Any other advise?
jb1 replied on at Permalink Reply
jb1
If you can provide the URL where you've installed the block I can take a closer look. Other than that, you can also try:
1) Turn on C5 caching - this way the block doesn't have to cycle through every page on your site to build the menu on each page load.
2) Test the menu on another page with minimal content to see if other content is slowing down the page load.
3) Same as point 2, but test with a different theme (one of the default themes that ship with C5).

Looking at Google Chrome's Developer Tools will help to determine which elements are slowing the page load.

Hope this helps.

JB
ZyberLimited replied on at Permalink Reply
ZyberLimited
Hi JB,

Thanks for the advise! :)

Actually I think the first fix did work but may be it had some caching and showed the result after a couple of days.
Thanks once again ! :)

concrete5 Environment Information

Version Installed - 8.3.2

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.