Member Offer
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

jQuery to control start time of Revolution Slider in WordPress

Discussion in 'Website Coding & Programming Forum:' started by chrismitchell, Dec 5, 2014.

  1. Hi Guys,

    I hope everyone is ok? Been extremely busy this year, hence not being about. I have a tricky question that I am looking for anyones help with. I'm hoping someone on here might be able to help me figure it out.

    I have this site: http://362.a07.myftpupload.com/ The password is: aynhoe_park

    I need to fix it so that the Revolution Sliders on each Section to only load when its scrolled onto. Can anyone suggest / give me some jQuery to force this to only start the sliders when the user is on the page with it. You will see that the site is a parallax and it has multiple sliders on the parallax.
    I have tried this code below, from the people at Revolution Slider, which doesn't seem to work:


    evapi5.on('revolution.slide.onloaded', function() {

    // slider reaches top of screen
    jQuery(this).waypoint(function(direction) {

    // slider scrolled into view
    if(direction === 'up') {
    jQuery(this).revresume();
    }

    // slider scolled out of view
    else {
    jQuery(this).revpause();
    }

    }, {offset: function() {

    return -jQuery(this).height();

    // slider reaches bottom of screen
    }}).waypoint(function(direction) {

    // slider scrolled into view
    if(direction === 'down') {
    jQuery(this).revresume();
    }

    // slider scrolled out of view
    else {
    jQuery(this).revpause();
    }

    }, {offset: function() {

    return jQuery(window).height();

    }});
    });
    So If someone can help me out that would be great! As I would love just one bit of code not one for each slider to force it to run the slider only when it is in the screen, not before hand.

    Thanks in advance.
     

Share This Page