Skip to content

Instantly share code, notes, and snippets.

@mattjburrows
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save mattjburrows/9549991 to your computer and use it in GitHub Desktop.

Select an option

Save mattjburrows/9549991 to your computer and use it in GitHub Desktop.
JS code snippets for the "Swipe activated gallery" tutorial on medium. Article URL to be confirmed.
(function(window, document, undefined) {
// Variable that we are going to store our functionality onto.
var App = {};
// Store the slide count.
App.slideCount = 8;
// Store a reference to the active slide.
App.active = 0;
// Store references to CSS classes for easy maintenance.
App.classes = {
hidden: 'is-hidden',
active: 'is-active',
animateIn: 'animate-in',
animateOut: 'animate-out'
};
// Store a reference to the animated state of the carousel.
App.animating = false;
// Wait for the page content to load before we initialise any functionality.
window.addEventListener('DOMContentLoaded', function() {});
})(window, document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment