【问题标题】:conflict between 2 ajax.googlepis code2 ajax.googleapis 代码之间的冲突
【发布时间】:2013-07-06 20:15:10
【问题描述】:

这是我的脑袋 jquery 链接。我的滑块使用 jquery 1.4.2,移动导航菜单使用 1.9.1。我需要两者都在我的网站上运行。请建议我如何在没有任何冲突的情况下运行这两个 jquery。

<script src="js/modernizr.custom.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/jquery.dlmenu.js"></script>
<script>
  $(function() {
    $( '#dl-menu' ).dlmenu({
      animationClasses : { classin : 'dl-animate-in-4', classout : 'dl-animate-out-4' }
    });
  });
</script>
<script type="text/javascript">
 $(document).ready(function(){
$("#myController").jFlow({
    slides: "#mySlides",
    width: "1000px",
    height: "335px",
    duration: 400
 });
 });
 </script>

提前谢谢..!

【问题讨论】:

  • 已在另一个question here 中回答。可以做到的,给我消息!

标签: jquery ajax slider conflict


【解决方案1】:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
    var jq191 = jQuery.noConflict();
</script>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
    var jq142 = jQuery.noConflict();
    jq142('#myController').jFlow({ /* etc... */ });
</script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多