thenitesharya

InfiniteScroll Settings

May 6th, 2021
738
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  2.  
  3. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/3.0.6/infinite-scroll.pkgd.min.js"></script>
  4.  
  5.  
  6. JS Part
  7. // InfiniteScroll Settings
  8. var nextURL;
  9. function updateNextURL( doc ) {
  10.   nextURL = $( doc ).find('.aryapage-next').attr('href');
  11.  
  12. }
  13. updateNextURL( document );
  14. var $container = $('.contentmain').infiniteScroll({
  15.   path: function() {
  16.     return nextURL;
  17.   },
  18.  
  19.   append: '.content',
  20.   history: 'push',
  21.   historyTitle: true,
  22.   status: '.page-load-status',
  23.   checkLastPage: '.aryapage-next'
  24.  
  25. });
  26. $container.on( 'load.infiniteScroll', function( event, response, path ) {
  27.   updateNextURL( response );
  28. });
  29.  
  30.  
  31.  
  32. HTML Part
  33. <div class="page-load-status">
  34.                         <div class="aload infinite-scroll-request">
  35.                             <span></span>
  36.                             <span></span>
  37.                             <span></span>
  38.                             <span></span>
  39.                         </div>
  40.                         <p class="infinite-scroll-last">ღƪ(ˆ◡ˆ)ʃ♡ That's all fancy text we have ♡ƪ(ˆ◡ˆ)ʃ♪</p>
  41.                         <p class="infinite-scroll-error">Error Contact<a
  42.                                href="mailto:?subject=Fancy%20Text%20Not%20Working;body=Site%20Not%20Working"
  43.                                target="_self" rel="noopener">hackersaitand@gmail.com</a></p>
  44.                     </div>
  45.                     <p class="aryapage">
  46.                         <a class="aryapage-next" href="symbolic.html">Next page</a>
  47.                     </p>
RAW Paste Data