这是我现在使用的滑块的代码:
JAVASCRIPT
function formatText(index, panel) {
return index + "";
$(function () {
$('.anythingSlider').anythingSlider({
easing: "easeInOutExpo", // Anything other than "linear" or "swing" requires the easing plugin
autoPlay: true, // This turns off the entire FUNCTIONALY, not just if it starts running or not.
delay: 5000, // How long between slide transitions in AutoPlay mode
startStopped: false, // If autoPlay is on, this can force it to start stopped
animationTime: 600, // How long the slide transition takes
hashTags: true, // Should links change the hashtag in the URL?
buildNavigation: false, // If true, builds and list of anchor links to link to each slide
pauseOnHover: true, // If true, and autoPlay is enabled, the show will pause on hover
startText: "Go", // Start text
stopText: "Stop", // Stop text
navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
});
$("#slide-jump").click(function(){
$('.anythingSlider').anythingSlider(5);
});
});
HTML
<div class="anythingSlider">
<div class="wrapper">
<ul>
<li>
<p><img alt="" width="582" height="255" src="IMAGELINK"></p>
<div class="container"><a href="LINK" class="info">TEXT</a></div>
</li>
<li>
<p><img alt="" width="582" height="255" src="IMAGELINK"></p>
<div class="container"><a href="LINK" class="info">TEXT</a></div>
</li>
</ul>
</div>
</div>
这是它在 JSFiddle 上的工作:http: //jsfiddle.net/LUEwg/1/
如您所见,它使用 jQuery (1.9.1)、AnythingSlider (v1.2) 和 Easing 插件(来自“外部资源”)。我想迁移到最新的 AnythingSlider 版本,即v.1.8.17。
问题是我的代码需要进行一些更改,因为它与 AnySlider 1.8.17 不兼容。
在这里您可以看到新旧版本之间的差异:http: //diffchecker.com/3zadzbvc