Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion swipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ function Swipe(container, options) {
var interval;

function begin() {

// stop the interval if interval still exists
if(interval){
stop();
}
delay = options.auto;
interval = setTimeout(next, delay);

}
Expand Down Expand Up @@ -334,6 +338,8 @@ function Swipe(container, options) {
translate(index, delta.x + slidePos[index], 0);
translate(index+1, delta.x + slidePos[index+1], 0);
}
//restart the animate
begin();

}

Expand Down Expand Up @@ -479,13 +485,18 @@ function Swipe(container, options) {

slide(to, speed);

//when end the slide ,restart the animate
begin();

},
prev: function() {

// cancel slideshow
stop();

prev();
// restart the animate
begin();

},
next: function() {
Expand All @@ -494,6 +505,8 @@ function Swipe(container, options) {
stop();

next();
// restart the animate
begin();

},
stop: function() {
Expand Down