S
S
Skinner2020-07-07 20:28:52
Java
Skinner, 2020-07-07 20:28:52

how to make infinite scroll in thymeleaf?

Friends, shoveled the Internet, I can not find anything intelligible on this issue. I'm using thymeleaf template engine and I'm trying to make an infinite scroll on loading news. Tell me, please, who came across, how best to do it? Where to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2020-07-07
@sergey-gornostaev

No way. Thymeleaf is the backend and infinite scroll is done on the front. Dig into JavaScript and AJAX.

O
Orkhan, 2020-07-07
Hasanly @azerphoenix

thymeleaf has nothing to do with it.
1) use some library for ajax pagination (be it infinite scroll or load more, etc.).
For example https://infinite-scroll.com/
https://www.sitepoint.com/jquery-infinite-scrollin...
https://github.com/brianmario/jquery-infinite-scroll
2) next implement RestController , which gives the content in json. Use Pageable to implement pagination
3) When the content scope is reached, send an Ajax request and increment the pageable to get the next page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question