API

Callbacks

Lightview provides a number of callbacks that can be used alongside other Options.

  • afterUpdate

    A function to call after the content of the window updates. The first argument will be the element that holds the content, the second argument the current position within the loaded group.

    afterUpdate: function(element, position) {
      $(element).css({ opacity: .5 });
      alert("You've reached position " + position);
    }
  • onHide

    A function to call when the window hides.

    onHide: function() {
      alert('Lightview is no longer visible');
    }
  • onShow

    A function to call when the window first comes into view.

    onShow: function() {
     alert('Lightview is visible');
    }

Contents

Sign in