2015-11-28 126 views
1

我的网站已经使用下面的外部文件成功:jQuery/Bootstrap冲突?

http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css 
http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js 
http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js 

现在我想实现需要 下列附加文件的工作jQuery的弹出窗口:

http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css 
http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js 

但现在文本在页面上被扭曲。它似乎垂直延伸 。

有没有人有建议?这两个jQuery文件和Bootstrap文件之间是否存在 之间的冲突?

谢谢。

+0

你有没有检查浏览器控制台的任何错误? –

+0

http://stackoverflow.com/questions/18636919/can-i-use-bootstrap-3-together-with-jquery-mobile –

+0

我检查,没有错误。感谢您的建议。 – CurtisD

回答

2

一个名为jQuery.noConflict()的特定jQuery函数可以用来消除与任何其他库的冲突。

你可以找到更多关于它在这里对这个Link

关于如何使用它的一小片段 -

<script src="other_lib.js"></script> 
<script src="jquery.js"></script> 
<script> 
$.noConflict(); 
jQuery(document).ready(function($) { 
    // Code that uses jQuery's $ can follow here. 
}); 
// Code that uses other library's $ can follow here. 
</script> 
+0

这似乎是一个好主意,我会尝试。我也可能用另一个例如jQuery.ui替换jQuery.mobile库。 – CurtisD

+0

回复,如果它适合你或我会尝试一些其他解决方案.... :) –

+0

我会尽快与我联系,只要我有机会尝试它。感谢您提供帮助。 – CurtisD