-
-
Save simon-lang/4507382 to your computer and use it in GitHub Desktop.
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
// Switch active card on swipe | |
$(".cards").hammer().bind("swipe", function(ev) { | |
if (ev.direction == "left") { | |
if (!activeCard.is(':first-child')) { | |
$('.card.active').removeClass('active').next('.card').addClass('active'); | |
} | |
} | |
else if (ev.direction == "right") { | |
if (!activeCard.is(':last-child')) { | |
$('.card.active').removeClass('active').prev('.card').addClass('active'); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment