Skip to content

Commit 49c5774

Browse files
committed
Merge pull request #149 from fieg/no-opera-mini
added scroll event detection and bail out when unsupported (fixes #146)
2 parents be2bb67 + 251298e commit 49c5774

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
@@ -354,9 +354,15 @@
354354
* @public
355355
*/
356356
IAS.prototype.initialize = function() {
357-
var currentScrollOffset = this.getCurrentScrollOffset(this.$scrollContainer),
357+
var supportsOnScroll = (!!('onscroll' in this.$scrollContainer.get(0))),
358+
currentScrollOffset = this.getCurrentScrollOffset(this.$scrollContainer),
358359
scrollThreshold = this.getScrollThreshold();
359360

361+
// bail out when the browser doesn't support the scroll event
362+
if (!supportsOnScroll) {
363+
return false;
364+
}
365+
360366
this.hidePagination();
361367
this.bind();
362368

0 commit comments

Comments
 (0)