Cycling through display of table entries on a timer?
Cycling through display of table entries on a timer?
Ocen
Posts: 3Questions: 2Answers: 0
I need to display 10 entries from the table, wait 10 seconds, then fade out (or slide out) those and display (by fade-in or slide-in) the next 10. Once all entries have been displayed, the program should loop back around to the first 10. I am pretty new to using DataTables and have no clue how to go about this. Could someone please help me? thanks!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Use the API
https://datatables.net/reference/api/
In particular, use
page()
,page(set)
andpage.len()
to loop through pages in the table.https://datatables.net/reference/api/page()
Use
setInterval()
to put the whole thing on a timer.Don't forget to call
draw()
at the end or you won't see the changes.As for animating it (fading/sliding), I don't know if you can do that.
Thank you! This worked perfectly.