jscroll icon indicating copy to clipboard operation
jscroll copied to clipboard

Do not self destroys when there is only one page

Open hemanth7787 opened this issue 10 years ago • 7 comments

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

hemanth7787 avatar Apr 30 '14 11:04 hemanth7787

I have the same issue. Did you solve it?

kopes18 avatar Sep 23 '14 16:09 kopes18

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();

dchaplinsky avatar Sep 28 '14 00:09 dchaplinsky

@pklauzinski please take a look onto proposed patch.

dchaplinsky avatar Sep 28 '14 00:09 dchaplinsky

@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) {

Dindaleon avatar Dec 01 '14 05:12 Dindaleon

Looking into it...

pklauzinski avatar Mar 03 '15 22:03 pklauzinski

+1

PS. Thanks for script. Love it :)

Cam avatar Mar 19 '15 02:03 Cam

+1

xplk-zz avatar Apr 23 '15 11:04 xplk-zz