jscroll
jscroll copied to clipboard
Do not self destroys when there is only one page
Simple test to reproduce the results
jquery :1.9.1
jscroll: v2.2.4
<html>
<body>
<div class="scroll">
<h3>Page 1</h3>
<p>Content here...</p>
<a >next</a>
</div>
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery.jscroll.min.js"></script>
<script type="text/javascript">
$('.scroll').jscroll({
loadingHtml: '<a>loading...</a>',
});
</script>
</body>
</html>
It will show loading... , if "loadingHtml" is a gif animation it plays indefinitely.
Thanks for creating a great jquery plugin
I have the same issue. Did you solve it?
index 829bdb7..5287a9d 100644
--- a/jquery.jscroll.js
+++ b/jquery.jscroll.js
@@ -43,6 +43,10 @@
_$scroll = _isWindow ? _$window : $e,
_nextHref = $.trim(_$next.attr('href') + ' ' + _options.contentSelector);
+ if (_$next.length == 0) {
+ return $e;
+ }
+
// Initialization
$e.data('jscroll', $.extend({}, _data, {initialized: true, waiting: false, nextHref: _nextHref}));
_wrapInnerContent();
@pklauzinski please take a look onto proposed patch.
@dchaplinsky I tried your proposal and it returns some errors. Instead, I just added this on line 109
&& _$next.length
if (!data.waiting && iTotalHeight + _options.padding >= $inner.outerHeight() && _$next.length) {
Looking into it...
+1
PS. Thanks for script. Love it :)
+1