Forum moderator: bigblog |
uCoz Community For Webmasters Custom Solutions New page auto load when scrolling down |
New page auto load when scrolling down |
Paradox, Do you have any idea to make this script work?
bigblog code Code <span class="lenta">$BODY$</span> <div id="ShowMore" pagenum="1"></div> <div id="more1"></div> <script type="text/javascript"> $(window).scroll(function(){ if ($(document).height() - $(window).height() <= $(window).scrollTop() + 50) { var $showclick = $('#ShowMore' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> .attr('pagenum' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> ; $('#more'+$showclick).after('<div id="more'+(parseInt($showclick)+1)+'"></div>' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> ; $showclick++; $('#more'+$showclick).load('$MODULE_URL$0'+'-'+$showclick+' .lenta' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> ; $('#ShowMore' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> .attr('pagenum',parseInt($showclick)); return false; } } <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> ; </script> |
Paradox, seems you have some ideas about this. Please help us make the script work. I only say characters in the script i don't understand anything so i can manipulate it so please kindly we request.
Systems developer
|
adnet, Soldierdevil, no guarantees but I'll have a tinker and see what I can come up with.
Cyberdasm, bigblog made some changes to the code Sunny posted. That's his version posted above on this page. Jack of all trades in development, design, strategy.
Working as a Support Engineer. Been here for 13 years and counting. |
Soldierdevil,
Paradox, seems you have some ideas about this. Please help us make the script work. I only say characters in the script i don't understand anything so i can manipulate it so please kindly we request. adnet, I have now the code for that Kindly check and scroll down up to the bottom of this page or this. I included the root domain incase my paid domain will expire tomorrow. I will put the code here tomorrow morning during office hours. 6:30 AM GMT+8. I 1F4BF3B
Post edited by Cyberdasm - Monday, 2016-12-05, 1:07 PM
|
Cyberdasm, please do so. I cant wait....oh my God. I am waiting impatiently
Systems developer
|
Soldierdevil, ahahah just be patient bro...
Okay, here it is just replace your body and page selector of your website: Code <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('»' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> ").text() == '»' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> { $("#selector").after('<div id="nextCont" class="input_submit alt"><div class="u_pos"></div></div>' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> ; }; $(window).scroll(function() { if($('.u_pos' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> .position().top-$(window).scrollTop() < 1000) { Conte.to() } }); Conte = { to:function(){ $("#nextCont").html('<div align="center"><img src="/.s/img/icon/ajsml.gif" border="0" /></div>' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> ; nextik = $("#selector").find(".swchItem:contains('»' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> ").attr('onclick' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> .toString(); num = nextik.match(/\d/); $.get('/publ/0-'+num, function(next){ $("#conter").append( $("#conter", next).html() ); $("#selector").html( $("#selector", next).html() ); $("#nextCont").html('<div class="u_pos"></div>' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> ; if ($("#selector", next).find(".swchItem:contains('»' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> ").html() == null) { $("#nextCont").fadeOut(); }; }); } } </script> Hope this helps. It work on mine and I'm sure it will work on yours. Added (2016-12-05, 11:12 PM) 1F4BF3B
Post edited by Cyberdasm - Monday, 2016-12-05, 11:03 PM
|
Cyberdasm, cant make it work on my site. Dont know why
Added (2016-12-06, 5:07 AM) Quote If you have time join as at discord. what is discord Systems developer
|
Soldierdevil, what site module are you using? Cyber's code is for the Publisher module.
And Discord is a community chat/VOIP application. Jack of all trades in development, design, strategy.
Working as a Support Engineer. Been here for 13 years and counting. |
Quote Cyber's code is for the Publisher module. Systems developer
|
Soldierdevil, unfortunately not. You've got to change the code for each module.
Code $.get('/publ/0-'+num, function(next){ This line of code is the trick. Take note of the following parameters:
On top of this you must also make sure that your entries have the correct class wrapper around them so they can be dynamically loaded from the page content. I can't find the specific class in the script, it's not so fantastically commented or readable, however, I'm sure @Cyberdasm will have an idea. Jack of all trades in development, design, strategy.
Working as a Support Engineer. Been here for 13 years and counting. |
Quote +num represents the current page value within the script, so by default it will start at 1, Systems developer
|
Nope. Don't change it. Was just explaining the script so you have an idea as to how it works. The value you may need to change is the: Code 0- It depends on how the modules paginate. Jack of all trades in development, design, strategy.
Working as a Support Engineer. Been here for 13 years and counting. |
Paradox, do you have any solution or idea about this code to make it work in photo album. The code owner seems to have disappeared since yesterday and i have been waiting all in vain
Systems developer
|
Soldierdevil,
Should work on Main, Section and Categories Page(s) Code <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="/.s/img/icon/ajsml.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> I modified it slightly to not throw any errors when a variable is undefined. Update: Seems to work on File Catalog well... Hit that "Thanks" button. :)
In life there's ALWAYS limits but do not plan above them. Post edited by VZ - Friday, 2017-01-20, 7:11 AM
|
| |||