1
我有jQuery的工具滚动插件的问题: http://jquerytools.org/documentation/scrollable/index.htmljQuery的工具滚动自动滚屏不暂停
而且采用滚动自动滚动插件: http://jquerytools.org/documentation/scrollable/autoscroll.html
我想,当一个链接到暂停播放幻灯片被点击,这是我的HTML标记:
<a id="pauseSlideshow" href="javascript:;">Pause Slideshow</a>
这里是我的javascript:
<script type="text/javascript">
var scrollableApi;
$(document).ready(function() {
// Initialize the slideshow
scrollableApi = $('#slideshow')
.scrollable({ items: '.scrollable > .items', circular: true, mousewheel: false, speed: 1000 })
.navigator({ navi: "#slideshow > .scrollable-nav", naviItem: "a", activeClass: "current" })
.autoscroll({ interval: 3000, autopause: true, api: true });
// Pause the slideshow when the link is clicked
$("#pauseSlideshow").click(function() {
alert("should pause slideshow");
scrollableApi.pause();
alert("no error");
});
});
</script>
我看到两个警报都显示,但幻灯片仍然是自动滚动。 Chrome检查器中没有控制台错误。
任何想法都会很棒,我发现jQuery工具文档缺乏如何使用这些API方法的示例。所以也许我错误地使用了它们?