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