Skip to content

Commit f78ce86

Browse files
committed
Prevent clicking links while swiping (IE11-Edge)
1 parent b07154c commit f78ce86

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

public/js/slider.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,13 @@
232232
this.$slider.on('dragstart', 'a, img', function (e) {
233233
e.preventDefault();
234234
});
235+
236+
// Don't follow links when swiping (IE 11 & Edge)...
237+
this.$slider.on('click', 'a', function (e) {
238+
if (this.isSliding) {
239+
e.preventDefault();
240+
}
241+
}.bind(this));
235242
}
236243

237244
// Window resize event...

src/js/slider.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@
164164
this.$slider.on('dragstart', 'a, img', function (e) {
165165
e.preventDefault();
166166
});
167+
168+
// Don't follow links when swiping (IE 11 & Edge)...
169+
this.$slider.on('click', 'a', function (e) {
170+
if (this.isSliding) {
171+
e.preventDefault();
172+
}
173+
}.bind(this));
167174
}
168175

169176
// Window resize event...

0 commit comments

Comments
 (0)