I would like to set up a system that would automatically paginate just jQuery / JavaScript with the rows I get.
The server can return 1 row as it can return me 1 million, and jQuery needs to organize those rows by hiding all the rows minus the last 2. For example it returns me those 5 rows
<div class="MSGR">Bom dia</div> --> NAO MOSTRAR
<div class="MSGR">Bom dia</div> --> NAO MOSTRAR
<div class="MSGR">Bom dia</div> --> NAO MOSTRAR
(ainda tem 3 opçoes SR.USUARIO)
<div class="MSGR">Bom dia</div> --> MOSTRAR
<div class="MSGR">Bom dia</div> --> MOSTRAR
It will show the last 2 rows and the rest will simply hide.
Above the rows shown there should be a button to show MORE rows .. a "load more" that shows two by two always showing how many rows are still to be displayed ... This load more button must exist as long as rows exist , when they are all displayed it has no function and should be hidden .. Type the facebook Messenger that you pull the messages from top to bottom and is displayed from X in X messages until finished.