From a59090cef2ec0e1c877dbd2eb5a2caef60b74828 Mon Sep 17 00:00:00 2001 From: Alon Zhang Date: Wed, 20 Aug 2014 14:37:58 +0800 Subject: [PATCH 1/6] after touchend, resume slide --- swipe.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/swipe.js b/swipe.js index 8b29717..0d96b2c 100644 --- a/swipe.js +++ b/swipe.js @@ -94,7 +94,6 @@ function Swipe(container, options) { } function next() { - if (options.continuous) slide(index+1); else if (index < slides.length - 1) slide(index+1); @@ -243,7 +242,8 @@ function Swipe(container, options) { switch (event.type) { case 'touchstart': this.start(event); break; case 'touchmove': this.move(event); break; - case 'touchend': offloadFn(this.end(event)); break; + case 'touchend': this.end(event); break; //modify by Alon Zhang + // case 'touchend': offloadFn(this.end(event)); break; case 'webkitTransitionEnd': case 'msTransitionEnd': case 'oTransitionEnd': @@ -417,8 +417,12 @@ function Swipe(container, options) { } // kill touchmove and touchend event listeners until touchstart called again - element.removeEventListener('touchmove', events, false) - element.removeEventListener('touchend', events, false) + element.removeEventListener('touchmove', events, false); + element.removeEventListener('touchend', events, false); + + //add by Alon Zhang + //resume slide + delay = options.auto; }, transitionEnd: function(event) { @@ -461,7 +465,7 @@ function Swipe(container, options) { } else { - window.onresize = function () { setup() }; // to play nice with old IE + window.onresize = function () { setup()}; // to play nice with old IE } From 5f8279f21058109313eccef4df56fdcaa7acb446 Mon Sep 17 00:00:00 2001 From: Alon Zhang Date: Wed, 20 Aug 2014 14:46:42 +0800 Subject: [PATCH 2/6] modify readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b2bc04a..61e8696 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +##Fixed Issues(By Alon Zhang) +After touchend event, resuming Swipe's auto slide. + ## Usage Swipe only needs to follow a simple pattern. Here is an example: From 3f15c6d3b0c44faf3230b9b07ec4c7399200529b Mon Sep 17 00:00:00 2001 From: Alon Zhang Date: Sun, 24 May 2015 19:38:44 +0800 Subject: [PATCH 3/6] adapt apicloud slidlayout --- README.md | 3 +++ index.html | 2 +- jquery-1.11.2.min.js | 4 ++++ swipe.js | 5 ++++- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 jquery-1.11.2.min.js diff --git a/README.md b/README.md index 61e8696..f8f3bb5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ ##Fixed Issues(By Alon Zhang) After touchend event, resuming Swipe's auto slide. +1. 兼容 APICloud +2. 兼容 openSlidLayout 模块 + ## Usage Swipe only needs to follow a simple pattern. Here is an example: diff --git a/index.html b/index.html index 196a580..01f494c 100644 --- a/index.html +++ b/index.html @@ -73,7 +73,7 @@

Swipe 2

- +