Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
infinite scroll not working
-
Hello,
I added infinite scroll to my app but it is not working I don’t know why
<ons-template id="home.html"> <ons-page id="mypage"> <div id="divContent"></div> </ons-page> </ons-template> <script> $('document').ready(function () { document.addEventListener('init', function (event) { var page = event.target; if (page.matches('#mypage')) { // Load more page.onInfiniteScroll = function (done) { alert('hi'); done(); }; } }); }); </script>
-
@Ahmed-Elshorbagy You don’t need to wait unttil the document is ready to set a listener. Add a
console.log
or anything there to make sure the init handler is running so we know if the problem is in your app or in the infinite scroll feature side.
-
I moved the alert message after page.matches and it worked, the problem is in page.onInfiniteScroll
-
still not working
-
@Ahmed-Elshorbagy Looks like it works well when I try. Example here.