JQuery accordion and colon clash

I am having a problem using colon and accordion on the same page i.e. none of them work. I have verified that they are using the latest jquery. Below are my inclusions. There are no other jscript files. I am using this in my wordpress template in case it might be causing the problem.

<script type="text/javascript" src="<?php bloginfo('url'); ?>/wp-content/themes/foxintouch/javascript/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('url'); ?>/wp-content/themes/foxintouch/javascript/jquery.accordion-1.2.2.js"></script>
<script type="text/javascript" src="<?php bloginfo('url'); ?>/wp-content/themes/foxintouch/javascript/jquery.accordion-1.2.2.source.js"></script>

<!-- thickbox -->

<script type="text/javascript" src="<?php bloginfo('url'); ?>/wp-content/themes/foxintouch/javascript/thickbox/thickbox.js"></script>
<link rel="stylesheet" href="<?php bloginfo('url'); ?>/wp-content/themes/foxintouch/javascript/thickbox/thickbox.css" type="text/css" media="screen" />

      

Here is the accordion call:

$(document).ready(function () {
 $('#sidebar ul').accordion();
 });

      

My site url is http://clients.bionic-comms.co.uk/fox/foxintouch-wp/issue/13/wesco-new-range/ Any help is appreciated. Thanks to

+1


a source to share


2 answers


Your coded include links to two versions of the jquery library. The first one (jquery-1.3.2.min.js) was extended by the accordion plugin, but then it was overwritten by the second library (jquery.js).

This broke your code $('#sidebar ul').accordion();

because the second jquery library did not contain a definition for the function accordion

(only the first jquery library was extended by the accordion plugin).

After you uninstalled the second jQuery library, the thick pane stopped working because thickbox 3.1 does not support jQuery 1.3+, but this can be easily fixed by changing one line in thickbox.js from:



TB_TempArray = $("a[@rel="+imageGroup+"]").get();

      

to

TB_TempArray = $("a[rel="+imageGroup+"]").get();

      

+4


a source


I'm not sure why you are using the noConflict function on your site - this is meant to disable the $ shortcut in jQuery, so it can be used with conflicting libraries like Prototype. Since your site seems to be using jQuery based code, you don't need this.

Disabling the $ shortcut results in an error in the Thickbox code, which in turn causes the JS to crash for the entire page.

Try to get rid of the noConflict code and just call the accordian function directly, like this:



 $(document).ready(function () {
     $('#sidebar ul').accordion();
 });

      

Also, you don't have to include both jquery.accordion-1.2.2.js and jquery.accordion-1.2.2.source.js, just use the compressed version of jquery.accordion-1.2.2.js yourself.

+1


a source







All Articles