You marked this article as outdated on August 2nd, 2018.

Guide Test

Oh hai.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. A nisi, pariatur iusto iure eaque voluptatem, minima sequi. Nulla unde eos ad architecto adipisci quidem, dolores, ipsa suscipit nisi, quisquam possimus.

new Hammer(document.querySelectorAll('.snap-deck')[0], { inputClass: Hammer.TouchInput, threshold: 0 }).on('panend', function(e) {
            // delta / width rounded means position change gets set to 1 if you're past half
            // width of the item
            var positionChange = Math.round(e.deltaX / trackWidth) * -1;


            // Don't move stuff if the angle swiped isnt in a 45 degree angle where the center
            // is a horizontal line. Otherwise, calculate whether we should go to the next item
            if (correctAngles(e.angle)) {
                // If the user is scrolling fast enough change positions
                positionChange = checkVelocity(e.velocity) !== 0 ? checkVelocity(e.velocity) : positionChange;

                // Don't change if we're at the end and trying to go the wrong way
                if (trackPos === 0 && positionChange === -1 || trackPos === numOfCards - 1 && positionChange === 1) {
                    positionChange = 0;

                    // console.log('doneskies');

                } else {
}}