【问题标题】:Conflict between colorbox and bootstrap libscolorbox 和引导库之间的冲突
【发布时间】:2012-06-12 08:58:55
【问题描述】:

ColorBox iFrameBootstrap, from Twitter 之间存在冲突.. 我正在尝试使用以下 coee 来解决冲突,但是同样的问题:

包括所需的库:

<script src="../jq/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../bootstrap/js/bootstrap.js" type="text/javascript"></script>  
<script src="../js/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>

彩盒js:

jQuery(document).ready(function ($) {

      // colorbox code here 
        });

和引导 js:

 $(document).ready(function () {

      // bootstrap twitter code here 
        });

【问题讨论】:

    标签: javascript jquery twitter-bootstrap colorbox


    【解决方案1】:

    只要jQuery === $ 在当前范围内,这两个函数的作用相同(通常是这种情况)。

    第一个版本更好,因为如果使用noConflict,它也可以工作。

    jQuery(document).ready(function($) {
        // both colorbox and bootstrap code here 
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-04
      • 1970-01-01
      • 2018-05-28
      • 2014-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多