how create pagination automatic with animation fadeindows
how create pagination automatic with animation fadeindows
Hello, I have a problem with my table, I wanted to do automatic auto-pagination with an effect, but I have not succeeded, my data is already displayed well, but I have not achieved automatic pagination or animation.
My code
<?php include_once "conexionsql.php"; $con=conectarse(); <?php > <!doctype html> ?> Hello, world!
Hello, world!
Tracto | Cliente | BITACORA | Orden | Carga | Dias | Horas | Destino | Status |
---|---|---|---|---|---|---|---|---|
TRACTO | Cliente | BITACORA | Orden | Carga | Dias | Horas | Destino | Status |
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.js"></script>
<script >
$(document).ready(function() {
function initTable(start) {
table = $('#example').DataTable({
"searching": false,
"destroy": true,
"displayStart": 4,
"pageLength": 12,
initComplete: function() {
var api = this.api();
var rowCount = api.rows({
page: 'current'
}).count();
for (var i = 0; i < api.page.len() - (rowCount === 0 ? 1 : rowCount); i++) {
$('#example tbody').append($("<tr ><td> </td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"));
}
}
});
}
var pageLen = Math.round(($(window).height() - 500) / 40);
var table;
$('#example').addClass('animated fadeInDown');
initTable(0);
setInterval(function() {
var info = table.page.info();
var pageNum = (info.page < info.pages) ? info.page + 1 : 1;
initTable(pageNum * pageLen);
}, 3000);
});
</script>
</body>
</html>
Answers
There is no option to do an fade / animation page change in DataTables I’m afraid.
Allan