如何修复页面中的jquery冲突?

时间:2016-02-15 07:08:31

标签: wordpress

<script src="http://www.watchoogle.com/wp-content/themes/woopress/js/baselworld/jquery-1.11.1.js"></script>

存在jquery冲突

我对jquery不太熟悉,我在控制台中发现了这个问题,但不知道如何消除冲突。

评论此脚本一切正常。但我想要这个jquery。

我使用了两个不同版本的两个jqueries。是因为那个? https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js

这是我遇到问题的页面链接。 http://www.watchoogle.com/baselworld-2016/

1 个答案:

答案 0 :(得分:0)

听着,直到我听说Wordpress不支持像$(选择器)。 而不是$你应该使用jQuery。

现在我已经检查过您使用了以下代码。

$(document).ready(function() {  

                var id = '#dialog';

                //Get the screen height and width
                var maskHeight = $(document).height();
.............

现在就像下面的代码那样做,让我知道。

jQuery.noConflict();
        jQuery(document).ready(function() { 

                var id = '#dialog';

                //Get the screen height and width
                var maskHeight = $(document).height();
                var maskWidth = $(window).width();

希望这项工作