I've implemented a multilevel dropdown menu on my website using a plugin, and it works as expected. However, there's an issue where the contents of the dropdown menu display for a brief moment while the page is loading. I tried adjusting the position of JavaScript and CSS files, as well as different versions of jQuery, but so far no luck in resolving the problem. The same issue occurs in the plugin's example, which I only noticed after integrating it into our CMS. At this point, it's too late to completely change it, so I'm looking for a way to fix it somehow. Unfortunately, I'm unable to share my working copy here. You can find my actual website here.
For reference, I've attached a JSFiddle.
<div class="page">
<div class="header">
<div class="header-menu">
...
$(function() {
$(window).resize();
});
$('#menu').dmenu({
menu : {
border : false,
logo : false,
align : 'center'
},
item : {
bg : false,
border : true,
fit : [
{
items : null,
fitter : 'icon-hide',
...
</li>
</ul>
</li>
</ul>
</li>
...
subitem : {
bg : true,
border : true
}
});