jQuery conflict issues between jScrollPane and NivoSlider WP plugin

北城以北 提交于 2020-01-05 12:55:35

问题


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

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

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

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

Here are the pastebins with the conflicting JS:

  • NivoSlider
  • jScrollPane

回答1:


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.

In my Wordpress install:

{wordpress directory}/wp-content/plugins/nivo-slider-for-wordpress/nivoslider4wp-show.php

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>

Issue resolved!



来源:https://stackoverflow.com/questions/10033167/jquery-conflict-issues-between-jscrollpane-and-nivoslider-wp-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!