How to add Scroll Offset to Revolution Slider Javascript

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);
    }
});

Hi @WestsideVirtual

Unfortunately this type of customization would be outside of the scope of our support.

You will need to search for a solution yourself or contact help from a developers.

Thank you

Edited for clarity

Hi there,

We don’t really provide support for any customization or coding, but if it’s easy and happened to be done by us personally, then there is no reason why should not provide it. I know you want to add additional behavior with 75px, but it’s not clear of when and how it should happen.

I recommend contacting a developer that’s familiar with RevSlider’s API.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.