I am trying to run the dual slider plugin alongside with an estalge view-box. They both use jQuery, and work separately but when i placed them together, one breaks. I have tried implementing the jQuery no conflict rule, but i think i may be missing a small detail somewhere. My coding so far looks like :
<script src="scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="scripts/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="scripts/jquery.timers-1.2.js" type="text/javascript"></script>
<script src="scripts/jquery.dualSlider.0.3.js" type="text/javascript"></script>
<!-- START ESTALGE -->
<script src="js/jquery-1.6.2.min.js"></script>
<script src="js/jquery.etalage.min.js"></script>
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($) {
jQuery('#etalage').etalage();
});
$(".carousel").dualSlider({
auto:true,
autoDelay: 6000,
easingCarousel: "swing",
easingDetails: "easeOutBack",
durationCarousel: 1000,
durationDetails: 500
});
</script>
Any help would be greatly appreciated. Thank You
If you have to use multiple versions of jquery then use
Now call the older version of jquery like
and newer version of jquery could be as follows
You can have multiple jQuery versions,
$.noConflict
will return you the jQuery object. You'd need to save it as another variable.DEMO: http://jsbin.com/uhazan/3/edit#javascript,html,live
NOTE: The
jQuery
variable will be set to 1.6.2 (the 2nd one), if you want it to be 1.3.2 (the 1st one), passtrue
to$.noConflict
.P.S. You may want to put your
$(".carousel").dualSlider
inside the$(document).ready(
.You are using
noConflict
incorrectly.You don't need two jQuery Core Lib includes
Try this instead:
Try placing your
slider
insidejQuery(document).ready(function($) {});
From the owner site
Does Etalage support jQuery no-conflict mode?
The plugin itself is noconflict ready. Just replace the
"$"
with"jQuery"
where you initiate the plugin, like so:The
$(".carousel").dualSlider({
line is outside thejQuery(document).ready()
function, which I'm pretty sure is not your intention. For the moment, this would work:However, there are other problems with your code. You are bringing in two versions of jQuery, one of which is very old (1.3.2). You won't get good results with this. If there is some library that relies on older jQuery, please consider not using that library. It probably won't work well on this page anyway, since any runtime activity of that library will only have access to jQuery 1.6. The jQuery .noConflict docs mention that you can supply boolean
true
as an argument to.noConflict
in order to free up the jQuery keyword as well, but by that time, your loaded plugins have already closed around the old version.