A
A
Anton-Pluton2018-02-26 21:09:58
PHP
Anton-Pluton, 2018-02-26 21:09:58

Automatic loading on scroll. Can this be done? If so, how?

I wanted to make automatic loading of blocks on the site when scrolling for ease of use. Could you help me with this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Leonid Knyazev, 2018-02-26
@Anton-Pluton

Automatic loading on scroll. Can this be done?

Yes, you can.
You hang an event handler on page scrolling and check whether you have scrolled to the point you need or not. If you screwed it up, then send an ajax request to the server to get a new batch of data and, after receiving it, insert this data on the page, in the place you need.

A
Andrey Sanych, 2018-02-26
@mountpoint

I do not want to be a bore, but in Google for the query "Autoload on scroll" a bunch of answers to your question

F
frees2, 2018-02-26
@frees2

It can be done much easier. When scrolling, the mouse will be in the box and the text will appear. Example

$(document).ready(function() { $('#btn1666').hover(function(){ $(this).remove();
$.getJSON('json/kolleksia.json', function(data) {for(var i=0;i<data.users.length;i++){

$('.canal').append('<br><input type=\"image\" name=\"message\" value=\"'+data.users[i].id+ '\" src=\"'+data.users[i].num+'\"> ' + data.users[i].text + ' <br><br><br>' ).hide().fadeIn(1000); 
}.......................

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question