From c23129899c52f90eff90c8880a0d4a862f9dd08c Mon Sep 17 00:00:00 2001 From: Tony Bogdanov Date: Wed, 4 Nov 2015 20:46:45 +0200 Subject: [PATCH 1/2] excluded option --- SmoothScroll.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/SmoothScroll.js b/SmoothScroll.js index 7fd3848..af9d870 100644 --- a/SmoothScroll.js +++ b/SmoothScroll.js @@ -94,6 +94,10 @@ function init() { activeElement = body; initTest(); + + if ('string' == typeof options.excluded && 0 < options.excluded.length) { + options.excluded = document.body.querySelectorAll(options.excluded); + } // Checks if this script is running in a frame if (top != self) { @@ -301,6 +305,15 @@ function wheel(event) { var target = event.target; var overflowing = overflowingAncestor(target); + if('object' == typeof options.excluded && 0 < options.excluded.length) { + for(var i = 0; i < options.excluded.length; i++) { + if(overflowing == options.excluded[i]) { + console.log('found'); + return true; + } + } + } + // use default if there's no overflowing // element or default action is prevented // or it's a zooming event with CTRL From fdf3a12e0f69c401fa6aa4e13ff167fc223aa05e Mon Sep 17 00:00:00 2001 From: Tony Bogdanov Date: Wed, 4 Nov 2015 21:12:43 +0200 Subject: [PATCH 2/2] typo --- SmoothScroll.js | 1 - 1 file changed, 1 deletion(-) diff --git a/SmoothScroll.js b/SmoothScroll.js index af9d870..9e72a43 100644 --- a/SmoothScroll.js +++ b/SmoothScroll.js @@ -308,7 +308,6 @@ function wheel(event) { if('object' == typeof options.excluded && 0 < options.excluded.length) { for(var i = 0; i < options.excluded.length; i++) { if(overflowing == options.excluded[i]) { - console.log('found'); return true; } }