title: jQuery conflicting with another jQuery
body: <p>I've got a curious case in which I believe two jQuery plugins are conflicting with each other: On one hand I've got a [ddsmoothmenu][1] that has worked fine until I've installed the (WP plugin) Revolution slider plugin. After I've installed it, the menu stopped working. The plugin has a no-conflict mode that once on, resolve the issue with the menu but other jQuery effects from other files/plugins stop working. One solution would be to replace the menu, but I really like it and would rather not (unless strictly necessary).</p>
  
  <p>Any suggestions?</p>
  
  <p>Many thanks</p>
  
  <p>Update: 
  here's the menu jQuery: </p>
  
  <pre><code>var ddsmoothmenu={
  
  //Specify full URL to down and right arrow images (23 is padding-right added to top level LIs with drop downs):
  arrowimages: {down:['downarrowclass', 'down.gif', 11], right:['rightarrowclass', 'down.gif']},
  transition: {overtime:300, outtime:300}, //duration of slide in/ out animation, in milliseconds
  shadow: {enable:false, offsetx:5, offsety:5}, //enable shadow?
  showhidedelay: {showdelay: 100, hidedelay: 200}, //set delay in milliseconds before sub menus appear and disappear, respectively
  
  detectwebkit: navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1, //detect WebKit browsers (Safari, Chrome etc)
  detectie6: document.all &amp;&amp; !window.XMLHttpRequest,
  css3support: window.msPerformance || (!document.all &amp;&amp; document.querySelector), //detect browsers that support CSS3 box shadows (ie9+ or FF3.5+, Safari3+, Chrome etc)
  ismobile:navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i) != null,     //boolean check for popular mobile browsers
  
  getajaxmenu:function($, setting){ //function to fetch external page containing the panel DIVs
  var $menucontainer=$('#'+setting.contentsource[0]) //reference empty div on page that will hold menu
  $menucontainer.html("Loading Menu...")
  $.ajax({
      url: setting.contentsource[1], //path to external menu file
      async: true,
      error:function(ajaxrequest){
          $menucontainer.html('Error fetching content. Server Response: '+ajaxrequest.responseText)
      },
      success:function(content){
          $menucontainer.html(content)
          ddsmoothmenu.buildmenu($, setting)
      }
  })
  </code></pre>
  
  <p>},</p>
  
  <pre><code>buildmenu:function($, setting){
  var smoothmenu=ddsmoothmenu
  var $mainmenu=$("#"+setting.mainmenuid+"&gt;ul") //reference main menu UL
  $mainmenu.parent().get(0).className=setting.classname || "ddsmoothmenu"
  var $headers=$mainmenu.find("ul").parent()
  $headers.hover(
      function(e){
          $(this).children('a:eq(0)').addClass('selected')
      },
      function(e){
          $(this).children('a:eq(0)').removeClass('selected')
      }
  )
  $headers.each(function(i){ //loop through each LI header
      var $curobj=$(this).css({zIndex: 100-i}) //reference current LI header
      var $subul=$(this).find('ul:eq(0)').css({display:'block'})
      $subul.data('timers', {})
      this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
      this.istopheader=$curobj.parents("ul").length==1? true : false //is top level header?
      $subul.css({top:this.istopheader &amp;&amp; setting.orientation!='v'? this._dimensions.h+"px" : 0})
      $curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: smoothmenu.arrowimages.down[2]} : {}).append( //add arrow images
          '&lt;img src="'+ (this.istopheader &amp;&amp; setting.orientation!='v'? smoothmenu.arrowimages.down[1] : smoothmenu.arrowimages.right[1])
          +'" class="' + (this.istopheader &amp;&amp; setting.orientation!='v'? smoothmenu.arrowimages.down[0] : smoothmenu.arrowimages.right[0])
          + '" style="border:0;" /&gt;'
      )
      if (smoothmenu.shadow.enable &amp;&amp; !smoothmenu.css3support){ //if shadows enabled and browser doesn't support CSS3 box shadows
          this._shadowoffset={x:(this.istopheader?$subul.offset().left+smoothmenu.shadow.offsetx : this._dimensions.w), y:(this.istopheader? $subul.offset().top+smoothmenu.shadow.offsety : $curobj.position().top)} //store this shadow's offsets
          if (this.istopheader)
              $parentshadow=$(document.body)
          else{
              var $parentLi=$curobj.parents("li:eq(0)")
              $parentshadow=$parentLi.get(0).$shadow
          }
          this.$shadow=$('&lt;div class="ddshadow'+(this.istopheader? ' toplevelshadow' : '')+'"&gt;&lt;/div&gt;').prependTo($parentshadow).css({left:this._shadowoffset.x+'px', top:this._shadowoffset.y+'px'})  //insert shadow DIV and set it to parent node for the next shadow div
      }
      $curobj.hover(
          function(e){
              var $targetul=$subul //reference UL to reveal
              var header=$curobj.get(0) //reference header LI as DOM object
              clearTimeout($targetul.data('timers').hidetimer)
              $targetul.data('timers').showtimer=setTimeout(function(){
                  header._offsets={left:$curobj.offset().left, top:$curobj.offset().top}
                  var menuleft=header.istopheader &amp;&amp; setting.orientation!='v'? 0 : header._dimensions.w
                  menuleft=(header._offsets.left+menuleft+header._dimensions.subulw&gt;$(window).width())? (header.istopheader &amp;&amp; setting.orientation!='v'? -header._dimensions.subulw+header._dimensions.w : -header._dimensions.w) : menuleft //calculate this sub menu's offsets from its parent
                  if ($targetul.queue().length&lt;=1){ //if 1 or less queued animations
                      $targetul.css({left:menuleft+"px", width:header._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'}, ddsmoothmenu.transition.overtime)
                      if (smoothmenu.shadow.enable &amp;&amp; !smoothmenu.css3support){
                          var shadowleft=header.istopheader? $targetul.offset().left+ddsmoothmenu.shadow.offsetx : menuleft
                          var shadowtop=header.istopheader?$targetul.offset().top+smoothmenu.shadow.offsety : header._shadowoffset.y
                          if (!header.istopheader &amp;&amp; ddsmoothmenu.detectwebkit){ //in WebKit browsers, restore shadow's opacity to full
                              header.$shadow.css({opacity:1})
                          }
                          header.$shadow.css({overflow:'', width:header._dimensions.subulw+'px', left:shadowleft+'px', top:shadowtop+'px'}).animate({height:header._dimensions.subulh+'px'}, ddsmoothmenu.transition.overtime)
                      }
                  }
              }, ddsmoothmenu.showhidedelay.showdelay)
          },
          function(e){
              var $targetul=$subul
              var header=$curobj.get(0)
              clearTimeout($targetul.data('timers').showtimer)
              $targetul.data('timers').hidetimer=setTimeout(function(){
                  $targetul.animate({height:'hide', opacity:'hide'}, ddsmoothmenu.transition.outtime)
                  if (smoothmenu.shadow.enable &amp;&amp; !smoothmenu.css3support){
                      if (ddsmoothmenu.detectwebkit){ //in WebKit browsers, set first child shadow's opacity to 0, as "overflow:hidden" doesn't work in them
                          header.$shadow.children('div:eq(0)').css({opacity:0})
                      }
                      header.$shadow.css({overflow:'hidden'}).animate({height:0}, ddsmoothmenu.transition.outtime)
                  }
              }, ddsmoothmenu.showhidedelay.hidedelay)
          }
      ) //end hover
  }) //end $headers.each()
  if (smoothmenu.shadow.enable &amp;&amp; smoothmenu.css3support){ //if shadows enabled and browser supports CSS3 shadows
      var $toplevelul=$('#'+setting.mainmenuid+' ul li ul')
      var css3shadow=parseInt(smoothmenu.shadow.offsetx)+"px "+parseInt(smoothmenu.shadow.offsety)+"px 5px #aaa" //construct CSS3 box-shadow value
      var shadowprop=["boxShadow", "MozBoxShadow", "WebkitBoxShadow", "MsBoxShadow"] //possible vendor specific CSS3 shadow properties
      for (var i=0; i&lt;shadowprop.length; i++){
          $toplevelul.css(shadowprop[i], css3shadow)
      }
  }
  $mainmenu.find("ul").css({display:'none', visibility:'visible'})
  </code></pre>
  
  <p>},</p>
  
  <pre><code>init:function(setting){
  if (typeof setting.customtheme=="object" &amp;&amp; setting.customtheme.length==2){ //override default menu colors (default/hover) with custom set?
      var mainmenuid='#'+setting.mainmenuid
      var mainselector=(setting.orientation=="v")? mainmenuid : mainmenuid+', '+mainmenuid
      document.write('&lt;style type="text/css"&gt;\n'
          +mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n'
          +mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n'
      +'&lt;/style&gt;')
  }
  this.shadow.enable=(document.all &amp;&amp; !window.XMLHttpRequest)? false : this.shadow.enable //in IE6, always disable shadow
  jQuery(document).ready(function($){ //ajax menu?
      if (typeof setting.contentsource=="object"){ //if external ajax menu
          ddsmoothmenu.getajaxmenu($, setting)
      }
      else{ //else if markup menu
          ddsmoothmenu.buildmenu($, setting)
      }
  })
  </code></pre>
  
  <p>}</p>
  
  <pre><code>} //end ddsmoothmenu variable​​
  </code></pre>
  
  <p>And no, I'm not loading more than one version of jQuery. I'm loading all jQuery through register and enqueue script within WordPress (sorry if I wasn't clear before, this is a WordPress site).</p>
  
  <p>The code for the WordPress Revolution Slider is a premium plugins, so I'm not sure I'm allowed to post it here. If anyone could help me clarify that I'd be more than happy to add as well</p>
  
  <p>Update 2: After additional tests, the conflicting jQuery files are these two (the oner above and this one): </p>
  
  <pre><code>(function($) {
  var aux     = {
          // navigates left / right
          navigate    : function( dir, $el, $wrapper, opts, cache ) {
  
              var scroll      = opts.scroll,
                  factor      = 1,
                  idxClicked  = 0;
  
              if( cache.expanded ) {
                  scroll      = 1; // scroll is always 1 in full mode
                  factor      = 3; // the width of the expanded item will be 3 times bigger than 1 collapsed item 
                  idxClicked  = cache.idxClicked; // the index of the clicked item
              }
  
              // clone the elements on the right / left and append / prepend them according to dir and scroll
              if( dir === 1 ) {
                  $wrapper.find('div.ca-item:lt(' + scroll + ')').each(function(i) {
                      $(this).clone(true).css( 'left', ( cache.totalItems - idxClicked + i ) * cache.itemW * factor + 'px' ).appendTo( $wrapper );
                  });
              }
              else {
                  var $first  = $wrapper.children().eq(0);
  
                  $wrapper.find('div.ca-item:gt(' + ( cache.totalItems  - 1 - scroll ) + ')').each(function(i) {
                      // insert before $first so they stay in the right order
                      $(this).clone(true).css( 'left', - ( scroll - i + idxClicked ) * cache.itemW * factor + 'px' ).insertBefore( $first );
                  });
              }
  
              // animate the left of each item
              // the calculations are dependent on dir and on the cache.expanded value
              $wrapper.find('div.ca-item').each(function(i) {
                  var $item   = $(this);
                  $item.stop().animate({
                      left    :  ( dir === 1 ) ? '-=' + ( cache.itemW * factor * scroll ) + 'px' : '+=' + ( cache.itemW * factor * scroll ) + 'px'
                  }, opts.sliderSpeed, opts.sliderEasing, function() {
                      if( ( dir === 1 &amp;&amp; $item.position().left &lt; - idxClicked * cache.itemW * factor ) || ( dir === -1 &amp;&amp; $item.position().left &gt; ( ( cache.totalItems - 1 - idxClicked ) * cache.itemW * factor ) ) ) {
                          // remove the item that was cloned
                          $item.remove();
                      }                       
                      cache.isAnimating   = false;
                  });
              });
  
          },
          // opens an item (animation) -&gt; opens all the others
          openItem    : function( $wrapper, $item, opts, cache ) {
              cache.idxClicked    = $item.index();
              // the item's position (1, 2, or 3) on the viewport (the visible items) 
              cache.winpos        = aux.getWinPos( $item.position().left, cache );
              $wrapper.find('div.ca-item').not( $item ).hide();
              $item.find('div.ca-content-wrapper').css( 'left', cache.itemW + 'px' ).stop().animate({
                  width   : cache.itemW * 2 + 'px',
                  left    : cache.itemW + 'px'
              }, opts.itemSpeed, opts.itemEasing)
              .end()
              .stop()
              .animate({
                  left    : '0px'
              }, opts.itemSpeed, opts.itemEasing, function() {
                  cache.isAnimating   = false;
                  cache.expanded      = true;
  
                  aux.openItems( $wrapper, $item, opts, cache );
              });
  
          },
          // opens all the items
          openItems   : function( $wrapper, $openedItem, opts, cache ) {
              var openedIdx   = $openedItem.index();
  
              $wrapper.find('div.ca-item').each(function(i) {
                  var $item   = $(this),
                      idx     = $item.index();
  
                  if( idx !== openedIdx ) {
                      $item.css( 'left', - ( openedIdx - idx ) * ( cache.itemW * 3 ) + 'px' ).show().find('div.ca-content-wrapper').css({
                          left    : cache.itemW + 'px',
                          width   : cache.itemW * 2 + 'px'
                      });
  
                      // hide more link
                      aux.toggleMore( $item, false );
                  }
              });
          },
          // show / hide the item's more button
          toggleMore  : function( $item, show ) {
              ( show ) ? $item.find('a.ca-more').show() : $item.find('a.ca-more').hide(); 
          },
          // close all the items
          // the current one is animated
          closeItems  : function( $wrapper, $openedItem, opts, cache ) {
              var openedIdx   = $openedItem.index();
  
              $openedItem.find('div.ca-content-wrapper').stop().animate({
                  width   : '0px'
              }, opts.itemSpeed, opts.itemEasing)
              .end()
              .stop()
              .animate({
                  left    : cache.itemW * ( cache.winpos - 1 ) + 'px'
              }, opts.itemSpeed, opts.itemEasing, function() {
                  cache.isAnimating   = false;
                  cache.expanded      = false;
              });
  
              // show more link
              aux.toggleMore( $openedItem, true );
  
              $wrapper.find('div.ca-item').each(function(i) {
                  var $item   = $(this),
                      idx     = $item.index();
  
                  if( idx !== openedIdx ) {
                      $item.find('div.ca-content-wrapper').css({
                          width   : '0px'
                      })
                      .end()
                      .css( 'left', ( ( cache.winpos - 1 ) - ( openedIdx - idx ) ) * cache.itemW + 'px' )
                      .show();
  
                      // show more link
                      aux.toggleMore( $item, true );
                  }
              });
          },
          // gets the item's position (1, 2, or 3) on the viewport (the visible items)
          // val is the left of the item
          getWinPos   : function( val, cache ) {
              switch( val ) {
                  case 0                  : return 1; break;
                  case cache.itemW        : return 2; break;
                  case cache.itemW * 2    : return 3; break;
              }
          }
      },
      methods = {
          init        : function( options ) {
  
              if( this.length ) {
  
                  var settings = {
                      sliderSpeed     : 500,          // speed for the sliding animation
                      sliderEasing    : 'easeOutExpo',// easing for the sliding animation
                      itemSpeed       : 500,          // speed for the item animation (open / close)
                      itemEasing      : 'easeOutExpo',// easing for the item animation (open / close)
                      scroll          : 1             // number of items to scroll at a time
                  };
  
                  return this.each(function() {
  
                      // if options exist, lets merge them with our default settings
                      if ( options ) {
                          $.extend( settings, options );
                      }
  
                      var $el             = $(this),
                          $wrapper        = $el.find('div.ca-wrapper'),
                          $items          = $wrapper.children('div.ca-item'),
                          cache           = {};
  
                      // save the with of one item    
                      cache.itemW         = $items.width();
                      // save the number of total items
                      cache.totalItems    = $items.length;
  
                      // add navigation buttons
                      if( cache.totalItems &gt; 3 )  
                          $el.prepend('&lt;div class="ca-nav"&gt;&lt;span class="ca-nav-prev"&gt;Previous&lt;/span&gt;&lt;span class="ca-nav-next"&gt;Next&lt;/span&gt;&lt;/div&gt;') 
  
                      // control the scroll value
                      if( settings.scroll &lt; 1 )
                          settings.scroll = 1;
                      else if( settings.scroll &gt; 3 )
                          settings.scroll = 3;    
  
                      var $navPrev        = $el.find('span.ca-nav-prev'),
                          $navNext        = $el.find('span.ca-nav-next');
  
                      // hide the items except the first 3
                      $wrapper.css( 'overflow', 'hidden' );
  
                      // the items will have position absolute 
                      // calculate the left of each item
                      $items.each(function(i) {
                          $(this).css({
                              position    : 'absolute',
                              left        : i * cache.itemW + 'px'
                          });
                      });
  
                      // click to open the item(s)
                      $el.find('a.ca-more').live('click.contentcarousel', function( event ) {
                          if( cache.isAnimating ) return false;
                          cache.isAnimating   = true;
                          $(this).hide();
                          var $item   = $(this).closest('div.ca-item');
                          aux.openItem( $wrapper, $item, settings, cache );
                          return false;
                      });
  
                      // click to close the item(s)
                      $el.find('a.ca-close').live('click.contentcarousel', function( event ) {
                          if( cache.isAnimating ) return false;
                          cache.isAnimating   = true;
                          var $item   = $(this).closest('div.ca-item');
                          aux.closeItems( $wrapper, $item, settings, cache );
                          return false;
                      });
  
                      // navigate left
                      $navPrev.bind('click.contentcarousel', function( event ) {
                          if( cache.isAnimating ) return false;
                          cache.isAnimating   = true;
                          aux.navigate( -1, $el, $wrapper, settings, cache );
                      });
  
                      // navigate right
                      $navNext.bind('click.contentcarousel', function( event ) {
                          if( cache.isAnimating ) return false;
                          cache.isAnimating   = true;
                          aux.navigate( 1, $el, $wrapper, settings, cache );
                      });
  
                      // adds events to the mouse
                      $el.bind('mousewheel.contentcarousel', function(e, delta) {
                          if(delta &gt; 0) {
                              if( cache.isAnimating ) return false;
                              cache.isAnimating   = true;
                              aux.navigate( -1, $el, $wrapper, settings, cache );
                          }   
                          else {
                              if( cache.isAnimating ) return false;
                              cache.isAnimating   = true;
                              aux.navigate( 1, $el, $wrapper, settings, cache );
                          }   
                          return false;
                      });
  
                  });
              }
          }
      };
  
  $.fn.contentcarousel = function(method) {
      if ( methods[method] ) {
          return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
      } else if ( typeof method === 'object' || ! method ) {
          return methods.init.apply( this, arguments );
      } else {
          $.error( 'Method ' +  method + ' does not exist on jQuery.contentcarousel' );
      }
  };
  
  })(jQuery); 
  </code></pre>
  
  <p>Any ideas on how to make this work? Any help is much appreciated.</p>