tags:

views:

115

answers:

1

i put 2 jquery plugin together inside a webpage. Conflict happen between the 2 jquery. When i take out 1 of the plugin code. It work. But when i put in 2 together. just 1 of jquery wil working well.

Can anyone help me solve tis?

 <script type="text/javascript" src="js/script.js"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />

<!--slide show-->
<link rel="stylesheet" href="css/main.css" type="text/css" media="all">
<link rel="stylesheet" href="css/slideshow.css" type="text/css" />

<script type="text/javascript" src="js/mootools.js"></script>
<script type="text/javascript" src="js/backgroundslider.js"></script>
<script type="text/javascript" src="js/slideshow.js"></script>

<script type="text/javascript">
    window.addEvent('domready',function(){
   var obj = {
    wait: 2000, 
    effect: 'fade',
    duration: 1000, 
    loop: true, 
    thumbnails: true,
    backgroundSlider: true,
    onClick: function(i){}
   }
   show = new SlideShow('slideshowContainer','slideshowThumbnail',obj);
   show.play();
  });
</script>

<!--Contact Slide-->
<link type="text/css" href="css/reset_contact.css" rel="stylesheet" />
<link type="text/css" href="css/styles.css" rel="stylesheet" />

<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/scripts.js" type="text/javascript"></script>
+2  A: 

You appear to be using MooTools and jQuery:

<script type="text/javascript" src="js/mootools.js"></script>
...
<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script>

Both libraries I believe use the $ shorthand. You will need to setup one or the other to not-use $ to avoid cross pollination of your code. ' Check out this article on jQuery and other libraries. Basically you call noConflict() like so:

 jQuery.noConflict();

and then in all your jQuery code, use jQuery in place of $:

$('foo').bar();

becomes

jQuery('foo').bar();
beggs
thx a lot.. i make it d..
JaYwZx