本文介绍了jScrollPane和NivoSlider WP插件之间的jQuery冲突问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与 jScrollPane 和NivoSlider WP插件有冲突.在安装NivoSlider之前,jScrollPane可以正常工作.安装后,出现以下错误:

I'm having a conflict issue with jScrollPane and the NivoSlider WP plugin. Prior to installing NivoSlider, jScrollPane was working fine. After installing it I'm getting the following error:

$('.scrollpane').jScrollPane is not a function

我已经尝试了我所知道的jQuery.noConflict的每种组合,并在文档.

I've tried every combination of jQuery.noConflict that I know of and that is listed in the documentation.

我还尝试了在此处找到的所有建议: jScrollPane滚动条问题

I've also tried all of the recommendations found here: jScrollPane Scrollbar Problem

这包括使用WPScrollPane插件,尽管它确实阻止了错误的发生,但它似乎不起作用.

That includes using the WPScrollPane plugin which does not seem to work although it does stop the error from occurring.

以下是带有冲突JS的粘贴框:

Here are the pastebins with the conflicting JS:

  • NivoSlider
  • jScrollPane

推荐答案

我跟踪了导致此问题的问题. NivoSlider WP插件通过Wordpress中的 wp_footer()钩子包括了jQuery的附加版本.为了解决这个问题,我进入了插件文件并编辑了nivoslider4wp-show.php.

I tracked down the problem causing this issue. The NivoSlider WP plugin was including an additional version of jQuery through the wp_footer() hook in Wordpress. To fix the issue I went into the plugin files and edited nivoslider4wp-show.php.

在我的Wordpress中安装:

In my Wordpress install:

在第32行上,我删除了:

And on line #32 I deleted:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

问题已解决!

这篇关于jScrollPane和NivoSlider WP插件之间的jQuery冲突问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 12:34