Skip to content Skip to sidebar Skip to footer

Using The 'afterrender' Callback In Fullpage.js To Run Code With Jquery Events

I'm using a library called fullPage.js to create a site. Within this I've used this setTimeout function to change a background image. setTimeout(function(){ $('#bg-opacity').css

Solution 1:

Just do this if you want to fire the timeout on page load:

new fullpage("#fullpage", {
  afterRender: function() {
    setTimeout(function() {
      $("#bg-opacity").css({
        opacity: 1,
        "background-image":
          "url(https://media.giphy.com/media/tIeCLkB8geYtW/giphy.gif)"
      });
    }, 300);
  }
});

Post a Comment for "Using The 'afterrender' Callback In Fullpage.js To Run Code With Jquery Events"