From 825f6a40ab2e7140505d877e7caf0b34d1aae3f8 Mon Sep 17 00:00:00 2001 From: Ulf Larsson <50082698+ularson@users.noreply.github.com> Date: Tue, 7 May 2019 00:17:45 +0200 Subject: [PATCH] Added filterTarget option to handle clickable events Added filterTarget option to be able to dynamically filter clickable events in jquery.kinetic. This makes it possible to use links, inputs or selects inside the scrolling div. Usage: $("div#makeMeScrollable").smoothDivScroll({ filterTarget: function (target, e) { if (!/down|start/.test(e.type)) { return !(/area|a|input|select/i.test(target.tagName)); } } }); --- js/source/jquery.smoothDivScroll-1.3.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/source/jquery.smoothDivScroll-1.3.js b/js/source/jquery.smoothDivScroll-1.3.js index 27cb68e..d0a74e2 100644 --- a/js/source/jquery.smoothDivScroll-1.3.js +++ b/js/source/jquery.smoothDivScroll-1.3.js @@ -79,7 +79,10 @@ // Easing for when the scrollToElement method is used scrollToAnimationDuration: 1000, // Milliseconds - scrollToEasingFunction: "easeOutQuart" // String + scrollToEasingFunction: "easeOutQuart", // String + + // Filter target (used by jquery.kinetic to handle clickable events) + filterTarget: false // Boolean }, _create: function () { var self = this, o = this.options, el = this.element; @@ -192,7 +195,8 @@ // Callback self._trigger("touchStopped"); - } + }, + filterTarget: o.filterTarget }); }