0

I am having some trouble with what looks to be conflicting JavaScript. I'm not the most savvy with it so I was hoping someone here could help me out.

The slider and menu both work on their own in a separate HTML page, but once I place it into the same HTML page it seems that they conflict and neither then work.

I have removed the menu JavaScript code in the head and the slider works so I am pretty sure this is the problem. You can see it live here.

totymedli
  • 29,531
  • 22
  • 131
  • 165
lbollu
  • 269
  • 4
  • 18

2 Answers2

0

You console show error

Uncaught ReferenceError: jQuery is not defined jquery.themepunch.plugins.min.js:140
Uncaught ReferenceError: jQuery is not defined jquery.themepunch.kenburn.min.js:8
Uncaught TypeError: Property '$' of object [object Object] is not a function commercial.html:32

Embed a suitable jQuery library file at the top of all the scripts

<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
Tushar Gupta - curioustushar
  • 58,085
  • 24
  • 103
  • 107
0

First of all, you have to include JQuery before you start to use the plugins, so move the line:

<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>

Before all your JavaScript includes.

Also, you use jQuery.noConflict() and we know that it "frees" the $ from being associated with jQuery so change this code:

var tpj=jQuery;
   tpj.noConflict();            
   tpj(document).ready(function() {
      if (tpj.fn.cssOriginal!=undefined)
         tpj.fn.css = tpj.fn.cssOriginal;
         tpj('.bannercontainer').kenburn(
         //Etc...

And use the $ sing everywhere.

   $(document).ready(function() {
      if ($.fn.cssOriginal!=undefined)
         $.fn.css = $.fn.cssOriginal;
         $('.bannercontainer').kenburn(
         //Etc...
Community
  • 1
  • 1
totymedli
  • 29,531
  • 22
  • 131
  • 165