jQuery没有冲突仍然与其他版本的jQuery发生冲突 [英] jQuery No Conflict Still Conflicts with Other Version of jQuery

查看:93
本文介绍了jQuery没有冲突仍然与其他版本的jQuery发生冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将双滑块插件与estalge视图框一起运行.它们都使用jQuery,并且分别工作,但是当我将它们放在一起时,就会中断.我尝试实现jQuery无冲突规则,但我认为我可能在某处缺少一个小细节.到目前为止,我的编码如下:

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

推荐答案

您错误地使用了noConflict.

<script src="scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

<!-- INCLUDE ANY SCRIPTS HERE THAT RELY ON 1.3.2 -->

<script type="text/javascript"> 
    // HERE WE CAN USE 1.3.2

    // re-assign 1.3.2 to a new variable so we can use it later
    var $jq132 = $.noConflict();
</script>

<script src="js/jquery-1.6.2.min.js"></script>

<script type="text/javascript"> 

    // $ is now 1.6.2 and $jq132 is 1.3.2, both can be used.

</script>

这篇关于jQuery没有冲突仍然与其他版本的jQuery发生冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆