Firozur Rahman
Firozur Rahman

Reputation: 45

Revolution slider stop and start on click

I am using jQuery revolution slider to my site. I want to stop and start slider on click. How can I do it.

$('.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
});

Upvotes: 3

Views: 9050

Answers (1)

Simon E.
Simon E.

Reputation: 58490

This (rather brief) API page explains the functions you can use with Revolution Slider, such as revpause() and revresume().

So if you want to stop the slider when a button is clicked, you need to have the button (or a link tag) somewhere on your page. Example...

<button id="stopButton">Stop</button>
<button id="resumeButton">Resume</button>

Then use the following 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();
});

Replace .rev-slider-banner-full with the class or ID of your slider element if it differs.

Upvotes: 9

Related Questions