2

我正在做一个网站以在移动设备中查看,并使用移动 css 和 jquery 来制作效果。我使用下面的代码来制作样式和效果。

<link rel="stylesheet" href="<?=base_url()?>css/jquery_01.css" /> 

 <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0-rc.2/jquery.mobile-1.1.0-rc.2.min.js"></script>

在我的网站中,我有一部分用于绘图,所以我使用了 jquery

http://slot.pixelass.com/

但是当我包含上述移动 jquery 时,用于绘图的 jquery 将不起作用。我不知道how to tackle jquery conflict

请有人帮助任何帮助将被appeciate。提前致谢

4

1 回答 1

0

调用了一个特定的 jQuery 函数jQuery.noConflict()来帮助消除与其他库的任何冲突。这是jQuery 文档的一个片段:

<script type="text/javascript">
  // This takes out the jQuery variable '$' from the global scope
  $.noConflict();
  jQuery(document).ready(function($) {
    // Code that uses jQuery's $ can follow here.
  });
  // Code that uses other library's $ can follow here.
</script>
于 2012-12-25T12:50:35.897 回答