|
|
Forum moderator: bigblog |
uCoz Community For Webmasters Design Customization auto page loader (New page auto load when scrolling down) |
auto page loader |
Hello,
Is there a script available for new page auto loading when scrolling down for BLOG? I found this one - http://forum.ucoz.com/forum/38-15585-101284-16-1371475070 but it ain't working for blog |
Ken_D, Yes, I belief so, I think their is a better method...we are given $CURRENT_PAGE$, we could set var to be one and execute peice of code each time the user scrolls to the page with an offset of 200px or so, adding +1 for the next page... without using the navigation buttons.
Hit that "Thanks" button. :)
In life there's ALWAYS limits but do not plan above them. |
Code <!-- <body> --> <div id="conter">$BODY$</div> <div class="selector" id="selector" style="display:none">$PAGE_SELECTOR$</div> <script type="text/javascript"> if ($("#selector").find(".swchItem:contains('»')").text() == '»') { $("#selector").after('<div id="nextCont" class="input_submit alt"><div class="u_pos"></div></div>'); }; $(window).scroll(function() { if($(".u_pos").length != 0) { if($('.u_pos').position().top-$(window).scrollTop() < 1000) { Conte.to() } } }); Conte = { to:function(){ $("#nextCont").html('<div align="center"><img src="/images/loading.gif" border="0" /></div>'); nextik = $("#selector").find(".swchItem:contains('»')").attr('href'); if(nextik !=undefined) { <?ifnot($PAGE_ID$ == "main" || $PAGE_ID$ == "main_page" )?> num = nextik.split(/\s*-\s*/)[1]; <?else?> num = nextik.match(/\d/); <?endif?> $.get('/$MODULE_ID$/<?ifnot($PAGE_ID$ == "main")?><?substr($URI_ID$,-1)?><?else?>0<?endif?>-'+num, function(next){ $("#conter").append( $("#conter", next).html() ); $("#selector").html( $("#selector", next).html() ); $("#nextCont").html('<div class="u_pos"></div>'); if ($("#selector", next).find(".swchItem:contains('»')").html() == null) { $("#nextCont").fadeOut(); }; }); } } } </script> its still working fine.. check on my site http ://indoxxi.info |
| |||
| |||