Home>Support>Navigation bar not working properly due to JavaScript conflict

Navigation bar not working properly due to JavaScript conflict

By Dennis, 10 years ago. Last reply by Dennis, 10 years ago.

Hello,

I am using comparison calculators of a third party (that need some JavaScript to run) with your Vantage theme which causes my site’s navigation bar to not work correctly anymore on the respective pages.
You can see an example at http://www.banking-24.com/vergleichsrechner/tagesgeldkonten-vergleichen/

The sub-menu still expands and you can click the links but nothing is visible to the user and the bar is not sticky anymore.
If you go to another section of the site (like http://www.banking-24.com/finanzratgeber/) or when you are on the homepage everything works as expected.
When I remove the calculator from a page it resolves the problem, so there must be a conflict between the scripts of the calculator and those used for the navigation bar.

Do you have an idea what might cause this, and if there is a solution for it that will let me keep both full navigation and calculator functionality?
Sadly I have close to no knowledge of JavaScript.

Thanks in advance,
Dennis

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 10 years, 5 months ago Greg Priday
    Hi, I Work Here

    Hi Dennis

    It’s possible that the calculator is causing Javascript issues that are halting the execution of the code for the menu bar. The only thing you can do there is ask the creator of the calculator to fix their JS issues (if that’s where the issue lies).

    If you can post the Javascript issues you’re getting, I might be able to point you in the right direction.

    http://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors#Step_3:_Diagnosis

  2. 10 years, 5 months ago Dennis

    Hi Greg,

    Thanks for your swift reply.

    I’ve already found out that the problems are caused by an inline use of jquery.min.js which is part of the calculator integration code.
    Here are the errors I get on the page that are caused by it (they are in German, though):

    getPreventDefault() sollte nicht mehr verwendet werden. Verwenden Sie stattdessen defaultPrevented. jquery.js:4
    Das angegebene Attribut auf Attributen sollte nicht mehr verwendet werden. Es liefert immer true. jquery.min.js:2
    getPreventDefault() sollte nicht mehr verwendet werden. Verwenden Sie stattdessen defaultPrevented. jquery.min.js:3

    I’ll talk to the creators about this as well, and will also ask them if this part of the code is even necessary.
    If you have any hints that might help me or them fix this issue they are very much appreciated.

    Thanks again!
    Dennis

  3. 10 years, 5 months ago Greg Priday
    Hi, I Work Here

    Unfortunately I can’t tell too much from those errors. They seem to be standard errors that come up fairly often in older jQuery code, but they aren’t critical errors. Let me know what the creators of the calculator say though. Maybe I’ll be able to help out.

  4. 10 years, 5 months ago Dennis

    Just wanted to let you know that the creator of the calculator advised me to just remove the line of code which calls the JQuery library, and now everything works fine. Probably your theme or WordPress itself already calls the right library just in a different version or so, and this might have caused the conflict.

    I just hope without this line the calculator won’t be causing any problems in the future.
    So far everything seems to be working, though. :-)

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More