冲突

2012-06-12 37 views
2

有使用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 
     }); 

回答

0

这两个函数在当前作用域(通常是这种情况)下,只要jQuery === $一样。

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

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