Create a gist now

Instantly share code, notes, and snippets.

anonymous /main.js Secret
Created Feb 9, 2018

What would you like to do?
$(function() {
var currentSlide = 1;
setInterval(function() {
$(".slides").css("margin-left", "-=1100");
$(".slides").on('transitionend webkitTransitionEnd oTransitionEnd', function() {
currentSlide++;
console.log(currentSlide);
if (currentSlide === $(".slide").length) {
currentSlide = 1;
$(".slides").css("transition", "0s");
$(".slides").css("margin-left", "0");
$(".slides").css("transition", "1s linear");
console.log("end");
}
});
}, 3000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment