javascript - 2 libraries of jquery still conflicting even with $.noConflict(); -
i cannot understand why theme still conflicting js found online.
my theme yin yang (http://onioneyethemes.com/yin-yang/)
and theme trying run quote rotator, put code here since website down since yesterday:
/* * jquery quovolver v1.0 - http://sandbox.sebnitu.com/jquery/quovolver * * sebastian nitu - copyright 2009 - rights reserved * */ (function($) { $.fn.quovolver = function(speed, delay) { /* sets default values */ if (!speed) speed = 500; if (!delay) delay = 6000; // if "delay" less 4 times "speed", break effect // if that's case, make "delay" 4 times "speed" var quaspd = (speed*4); if (quaspd > (delay)) delay = quaspd; // create variables needed var quote = $(this), firstquo = $(this).filter(':first'), lastquo = $(this).filter(':last'), wrapelem = '<div id="quote_wrap"></div>'; // wrap quotes $(this).wrapall(wrapelem); // hide quotes, show first $(this).hide(); $(firstquo).show(); // set hight of wrapper $(this).parent().css({height: $(firstquo).height()}); // magic happens setinterval(function(){ // set required hight , element in variables animation if($(lastquo).is(':visible')) { var nextelem = $(firstquo); var wrapheight = $(nextelem).height(); } else { var nextelem = $(quote).filter(':visible').next(); var wrapheight = $(nextelem).height(); } // fadeout quote visible $(quote).filter(':visible').fadeout(speed); // set wrapper hight of next element, fade element in settimeout(function() { $(quote).parent().animate({height: wrapheight}, speed); }, speed); if($(lastquo).is(':visible')) { settimeout(function() { $(firstquo).fadein(speed*2); }, speed*2); } else { settimeout(function() { $(nextelem).fadein(speed); }, speed*2); } }, delay); }; })(jquery);
i pretty sure reason why doesn't work conflict of theme js backlink jquery
removing this:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
would make theme work. , adding (requirement of rotator) disable effects of theme.
here did try remove conflict:
<script type="text/javascript"> $.noconflict(); $(document).ready(function() { $('blockquote').quovolver(); }); </script>
but still no luck. can me remove conflict?
try instead
jquery(document).ready(function($){ // can use `$` inside func, // not show errors $('blockquote').quovolver(); }); $.noconflict(true);
Comments
Post a Comment