Skip to content

Commit 251298e

Browse files
committed
added scroll event detection and bail out when unsupported
1 parent 32cf4d9 commit 251298e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/jquery-ias.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,15 @@
324324
* @public
325325
*/
326326
IAS.prototype.initialize = function() {
327-
var currentScrollOffset = this.getCurrentScrollOffset(this.$scrollContainer),
327+
var supportsOnScroll = (!!('onscroll' in this.$scrollContainer.get(0))),
328+
currentScrollOffset = this.getCurrentScrollOffset(this.$scrollContainer),
328329
scrollThreshold = this.getScrollThreshold();
329330

331+
// bail out when the browser doesn't support the scroll event
332+
if (!supportsOnScroll) {
333+
return false;
334+
}
335+
330336
this.hidePagination();
331337
this.bind();
332338

0 commit comments

Comments
 (0)