2012-04-12 29 views
2

的jQuery的衝突我做一個網站來查看手機,並已用於effects.i移動CSS和jQuery已經使用了樣式和效果下面的代碼。如何解決在jQuery Mobile的和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.I我不知道的jQuery

http://slot.pixelass.com/ 

但jQuery的一部分的how to tackle jquery conflict

請有人幫助任何幫助將appeciated。 在此先感謝

+0

爲什麼不只用jquery mobile? – Baz1nga 2012-04-12 07:14:31

+0

我已經嘗試了很多老虎機找到一個移動jquery,但我不明白它 – 2012-04-12 07:17:22

+0

http://jquerymobile.com/demos/1.0a2/experiments/api-viewer/docs/jQuery.noConflict/index.html這可能會幫助你 – Baz1nga 2012-04-12 07:20:20

回答

0

有一個特定的jQuery函數jQuery.noConflict()幫助消除與其他庫的任何衝突。這裏是jQuery's documentation的一個片段:

<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>