Mega drop downs not working

It seems the mega drop downs we have are only working consistently on the homepage of our site. Can anyone help take a look at this? for example works all the time, where… doesn’t. Thanks.

Do you happen to know what javascript you are using for the Mega drop downs?

Looking at your code, I noticed that on the homepage you didn’t reference the superfish.js script but on the page that isn’t working, it’s there. Not sure that will fix it. I’m using superfish on our new website but I’m not having any issues with it.

I also noticed that on the page not working, You reference two files incorrectly. On the homepage you have this:

<script src="/Assets/elqNow/elqCfg.js" type="text/javascript"> <br /> <script src="/Assets/elqNow/elqImg.js" type="text/javascript"> <br />

But on the page not working it looks like this:

<br /> <script src="elqNow/elqCfg.js" type="text/javascript"> <br /> <script src="elqNow/elqImg.js" type="text/javascript"> <br />

Good catch there Matt! Jerome if the problem persists, feel free to let us know!

Thanks for the reply. the puzzling thing to me is why the mega drops work in the CM1 preview but not in the publish. I’ll look into the superfish script.

I have been working on this issue now for a while and cannot seem to find a resolution. I find a number of differences in the code when I compare pages that have a working megadrop and pages that do not have a megadrop. I have tried to disable many of the codes that are on the non-working pages to match the working pages through Firebug but have not found a solution. I duplicated the template and tried making edits to the code on the duplicate but cannot locate all the JS files to remove them from the code (for example, the superfish.js file). The above issue on the elq files doesn’t seem to make a difference unfortunately (it’s for Eloqua).

Working Dropdown:…
nonworking Dropdown:

The very puzzling part of this is that the megadrop menu works in the CM1 preview but NOT in the published page.

Help Me Obi-Wan Kenobi, You’re My Only Hope.

Hi Jerome,

I have been looking into this issue and unfortunately I haven’t come up with a solution yet. I did realize some differences between the pages that work vs. pages that don’t. I am not sure if this may be causing the issue however at this point, its worth a try.

Review the following two screenshots. One from a page that the navigation works and the other doesn’t. One mentions div id=“navigation” the other mentions div id =“nav”

thanks for the feedback. I tried updating the nav to navigation. sadly no luck

IN looking at the published code, I see that the megadrop has the following only in the published code on the page that doesn’t work…could this be the problem?

On the page that does work, this is the same code area:

Hi Jerome,

On your pages where this is not working, there is a function in your main.js file that’s not being called, possibly due to an error in another JS file halting script executions that rely on jQuery’s .ready method. It will take some debugging to determine the root cause of this. The function in question is “Site.init()”.

As a workaround, you may be able to call this function from an inline script that’s housed at the end of your page’s body tag.

To try this, open up your Compliance and Fraud page, edit the page’s Meta-data, and then find the “Code insert before body close” field within the Addition Code menu and paste in this code:

<script type="text/javascript">Site.init()</script>

Then publish out this page and see if it works on your live site. If it does, relocate this code to the template level and run a full publish of your site.

Thanks Nathaniel, I tried the code suggested and nothing changed. We have been looking at the site and one of our guys found the following:

“It appears that on each page where the drop down does not function, there is a syntax error that shows up in the perc_common_ui.js file during page load. As is common in javascript, an error in a script can cause subsequent ones not to fire. That is what I am suspecting is stopping the Site.init() from going off.”

Can this be reviewed to see if it can be resolved? Thanks for your help.

Hi Jerome,

There does seem to be some underlying issue with how some of your JavaScript interacts with our perc_common_ui.js code on that particular page (interestingly, perc_common_ui.js runs fine on your home page). We’ll have to take a closer look into what’s happening here.

That said, the script I shared with you should work (I tested it with your page’s code locally), however I should have specified that it will need to appear below the reference to your main.js file or else it wont function.

To get this into the right place, you’ll need to edit your “Compliance and Fraud” page’s Template, toggle over to the Content tab, access the Meta-data > Addition Code > “Code insert before body close” text field, and drop the above code below any existing code. Once you’ve done this, save the Template, and then publish your “Compliance and Fraud” page. Let me know if this still doesn’t work, and I’ll take a look at your code again.

Nathaniel, That seems to have worked. I’m going to do a site publish and see if the other pages are affected as well. Thanks for the extra effort.

Great! Let me know if this corrects the issue on your other pages as well.