我正在我的网站上使用 jQuery Revolution slider 。我想在点击停止和开始 slider >。我该怎么做。
$('.rev-slider-banner-full').revolution({
delay: 7000,
startwidth: 960,
startheight: 600,
onHoverStop: "off",
thumbWidth: 100,
thumbHeight: 50,
thumbAmount: 3,
hideThumbs: 0,
navigationType: "none",
navigationArrows: "solo",
navigationStyle: "bullets",
navigationHAlign: "center",
navigationVAlign: "bottom",
navigationHOffset: 30,
navigationVOffset: 30,
soloArrowLeftHalign: "left",
soloArrowLeftValign: "center",
soloArrowLeftHOffset: 20,
soloArrowLeftVOffset: 0,
soloArrowRightHalign: "right",
soloArrowRightValign: "center",
soloArrowRightHOffset: 20,
soloArrowRightVOffset: 0,
touchenabled: "on",
stopAtSlide: -1,
stopAfterLoops: -1,
hideCaptionAtLimit: 0,
hideAllCaptionAtLilmit: 0,
hideSliderAtLimit: 0,
fullWidth: "on",
fullScreen: "off",
fullScreenOffsetContainer: "#topheader-to-offset",
shadow: 0
});
最佳答案
This (rather brief) API page解释了可以与 Revolution Slider 一起使用的功能,例如 revpause()
和 revresume()
。
因此,如果您想在单击按钮时停止 slider ,则需要在页面上的某个位置放置该按钮(或链接标记)。示例...
<button id="stopButton">Stop</button>
<button id="resumeButton">Resume</button>
然后使用以下 jQuery...
// When stop button is clicked...
$('#stopButton').on('click', function(e){
$('.rev-slider-banner-full').revpause();
});
// When resume button is clicked...
$('#resumeButton').on('click', function(e){
$('.rev-slider-banner-full').revresume();
});
将 .rev-slider-banner-full
替换为 slider 元素的类或 ID(如果不同)。
关于jquery - 革命 slider 单击停止并开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20952192/