Hi Themeco,
I have a 5 page Revolution Slider. After the 5th and last slide ends, I call the following Javascript from within Rev Slider to automatically scroll to the next section below the slide, and it works fine. However, I want to add one additional behavior to scroll with an offset = 75px and I don’t know how to write that and add it to the the following code.
Can you please help?
Thank you in advance,
// the speed of the scrolling transition (ms)
var scrollTime = 2000;
// the amount of time before the scrolling begins (ms)
var scrollDelay = 500;
// change the "revapi7" part with your slider's ID
// https://tinyurl.com/zb6hzpc
var api = revapi7.on('revolution.slide.onchange', function(e, data) {
if(data.slideIndex === api.revmaxslide()) {
setTimeout(function() {
var bounds = api[0].getBoundingClientRect();
jQuery('html, body').animate({
scrollTop: window.pageYOffset + bounds.top + bounds.height
}, scrollTime);
}, scrollDelay);
}
});