Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » New page auto load when scrolling down
New page auto load when scrolling down
Eriko
Pokémon Master
Posts: 962
Reputation: 34

Message # 31 | 2:30 PM
dense0293, infinite scroll is not possible with informers.
Cyberdasm
Posts: 639
Reputation: 7

Message # 32 | 4:06 AM
YamiTatsuro, as for now sir but maybe in the near future we can possibly use it in good use...,, smile
1F4BF3B
FOF
Posts: 19
Reputation: 0

Message # 33 | 6:24 PM
At last i got it working. Thanks a lot to Jackson Mihailov who created this script. Although, Sunny tried to help me a lot. She came along with one solution but it wasn't that appropriate as this is. Thanks anyway.

So those who want this great script check this.
Just download the javascript.
Upload it in your file manager.
Replace $BODY$ with the code shown.
<script src="link to script JMpagesList "></script> put the .js link here.

Check it working here.

Good luck everyone! smile
Post edited by FOF - Sunday, 2013-10-06, 6:26 PM
Mar1aN
Posts: 192
Reputation: 3

Message # 34 | 8:54 PM
FOF, i have some problems with that script

on this site:
in the file catalog module, the script opens only two pages ("/load/0-2" and "/load/0-3") and after that he stops opening next pages.
but
on this site

in the same module as in the above site, the script worsk fine.

Another problem is with the photo module, i tried to put the script on the first page of the photo module (on both sites) and it didin't work.

My questions are:

Why on my first site, the script loads only two pages?
How can i make the script work in the first page of photo module?
How can i make my share buttons work in the loaded pages?

Added (2013-10-14, 2:54 PM)
---------------------------------------------
I will pay 6.18$ the one who will give me the answers for my questions!


FOF
Posts: 19
Reputation: 0

Message # 35 | 6:37 PM
Mar1aN, as ucoz did some updates the code didn't work properly anymore. I talked to Jackson and he is willing to fix this problem. I will put the update here as soon as he informs me.
Post edited by FOF - Thursday, 2013-10-24, 6:38 PM
Mar1aN
Posts: 192
Reputation: 3

Message # 36 | 11:49 PM
FOF, ok smile .

Added (2013-11-19, 6:56 AM)
---------------------------------------------
Any news?

Added (2014-01-29, 10:41 AM)
---------------------------------------------
I still don't know why this script does not work correctly on my website.
When i scroll down on photo module(/photo/1/) the script adds 2 times the number of entries from the first page.
Can someone who's good at javascript please help me?

Script source

Website where the script works
http://tavaidienai.ucoz.com/js/JMpagesListSpecEditionAlbumOnly.js
http://tavaidienai.ucoz.com/js/pageautoload.js

I tried to contact FOF, but he didn't answer.

Post edited by Mar1aN - Sunday, 2014-02-02, 11:50 PM
lanh
Posts: 135
Reputation: 0

Message # 37 | 1:43 PM
I dont know if uCoz will launch this feature. Hope to see it in the near future.

Soldierdevil
Posts: 154
Reputation: 1

Message # 38 | 2:48 PM
Anybody with this script lets negotiate a price
Systems developer
Cyberdasm
Posts: 639
Reputation: 7

Message # 39 | 7:41 AM
Soldierdevil, I'm not the owner of this code. According to sunny(the owner of the code) you must change the $BODY$ of you page with this 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>

1F4BF3B
Soldierdevil
Posts: 154
Reputation: 1

Message # 40 | 12:10 PM
Cyberdasm, have used this code before and never worked. Wish i would get the right one. Its the only component lacking on my site to be perfect but all i tried are not compatible with ucoz system
Systems developer
joexyz
JOE-vascript
Posts: 1770
Reputation: 78

Message # 41 | 4:03 PM
Soldierdevil, Cyberdasm, few corrections:
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').attr('pagenum');   
$('#more'+$showclick).after('<div id="more'+(parseInt($showclick)+1)+'"></div>');   
$showclick++;   
$('#more'+$showclick).load('$MODULE_URL$0'+'-'+$showclick+' .lenta');   
$('#ShowMore').attr('pagenum',parseInt($showclick));   
return false;   
} };);
</script>

hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau

sometimes i lurk here
adnet
Posts: 42
Reputation: 2

Message # 42 | 1:02 AM
bigblog, could you please teach me how to use the above code? Do I need to have more script or CSS to run it or only copy and paste into module main page? Thank you.
Soldierdevil
Posts: 154
Reputation: 1

Message # 43 | 6:17 AM
bigblog, i really love this code but dont know how to get around with it. I pasted everything i see to the video module but nothing happens.
Systems developer
Cyberdasm
Posts: 639
Reputation: 7

Message # 44 | 6:51 AM
Same here... but I try my best to make it work. heheh smile Still it don't run.
If I'm not mistaken this script has a function to click show more.

Added (2016-11-30, 6:51 AM)
---------------------------------------------
I don't know if it will worked out. I tried to convert it.

Code
<script>
var track_page = 1; //track user click as page number, right now page number is 1
load_contents(track_page); //load content

$("#load_more_button").click(function (e) { //user clicks on button
    track_page++; //page number increment everytime user clicks load button
    load_contents(track_page); //load content
});

//Ajax load function
function load_contents(track_page){
    $('.animation_image' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> .show(); //show loading image
    
    $.post( 'fetch_pages.php', {'page': track_page}, function(data){
        
        if(data.trim().length == 0){
            //display text and disable load button if nothing to load
            $("#load_more_button").text("No more records!").prop("disabled", true);
        }
        
        $("#results").append(data); //append data into #results element
        
        //scroll page to button element
        $("html, body").animate({scrollTop: $("#load_more_button").offset().top}, 800);
    
        //hide loading image
        $('.animation_image' <img src="/.s/sm/1/wink.gif" border="0" align="absmiddle" alt="wink" /> .hide(); //hide loading image once data is received
    });
}
</script>

1F4BF3B
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 45 | 9:46 AM
Cyberdasm, the script you're using is requesting data from a PHP script.

Code
$.post( 'fetch_pages.php', {'page': track_page}, function(data){


You need to either write a PHP script to handle the post request, or go back and have a look at the script bigblog posted earlier. smile

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
uCoz Community » For Webmasters » Custom Solutions » New page auto load when scrolling down
Search: