Last active
September 27, 2017 07:28
-
-
Save JimBobSquarePants/94c9504173c185752c2e3735c1235345 to your computer and use it in GitHub Desktop.
Demo for consuming the swiper code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="swiper.js"></script> | |
<script> | |
let swiper = new Swiper(".target"); | |
swiper.onSwipeMove(e => { /* Can track delta here */ }) | |
.onSwipeEnd(e => { | |
swiper.elements.forEach(function (element) { | |
element.innerHTML = "<br>Direction: " + e.detail.direction | |
+ "<br>Distance: x = " + e.detail.delta.x + ",y = " + e.detail.delta.y | |
+ "<br>Duration: " + e.detail.duration + "ms"; | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment