Unite Revolution 滑块与 Joomla 中的 jquery 冲突


Unite Revolution Slider Conflicts With jquery in Joomla

>每当我在joomla模板的正文中添加下面的脚本时(即默认.php),革命滑块就会停止工作。

<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

请告诉我如何解决此冲突,因为我网站上的另一个滑块需要该脚本才能运行。

当你使用Joomla 3.1时,你应该使用以下方法导入jQuery,这也将自动使用noConflict模式:

JHtml::_('jquery.framework');

有关更多信息(包括为Joomla 2.5导入它的最佳方法),请参阅我不久前发布的以下答案:

将jQuery导入Joomla

希望这有帮助

我认为noConflict()可能会帮助你:

$.noConflict();
// Code that uses other library's $ can follow here.
</script>

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