A
A
Alexey Popov2015-11-23 00:51:29
JavaScript
Alexey Popov, 2015-11-23 00:51:29

How to dynamically load content vertically?

f09c6f7ec1f5414293f7ecd3a1aec458.jpg
Good afternoon, the task is to implement horizontal scrolling (I know it’s not a very good idea, it will interfere with the user in terms of usability)
But the client wants that’s all
Here is an example:
www.archi-graphi.fr

The problem is what needs to be done dynamically and not statically ( that is, the content should be loaded news (categories) but gradually so as not to load the site.I
really hope for your help, since I have a dead end in implementation.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sanes, 2015-11-23
@Sanes

Easily

V
Vitaly Inchin ☢, 2015-11-23
@In4in

The algorithm is no different from loading vertically.
For example:

var curPage = 1, online;

document.onscroll = function(){
  if(window.pageXOffset > this.body.offsetWidth - 2 * window.innerWidth){
    if(online){
       return;
    }else{
       online = curPage++, true;
    }
    //Подгружаем новый контент страницы под номером curPage
    //Не забываем по окончанию запроса приравнять online к false
    //Если в ответе пусто, т.е, статьи кончились - убираем обработчик scroll
  }
}

Or are you having problems on the server side?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question