pagination Auto-Scroll

pagination Auto-Scroll

jnymrisjnymris Posts: 10Questions: 0Answers: 0
edited January 2012 in Plug-ins
Hello. I'm looking for a way to "AutoScroll" through the pages.


What would be the best way to do this? If it's going to be a problem I do have two datatables on this page
id="tablemissing"
& id="tablefailed"

I have tried using jQuery to call $('#tablemissing_next').click() however that is not actioning anything and then of course we need to consider the looping option where if it is the last page we need to jump back to page one.

Any suggestions?

If I find a solution I will report back

Replies

  • jnymrisjnymris Posts: 10Questions: 0Answers: 0
    edited January 2012
    Edit2: Okay i have managed to create a function that almost works (Jumps to page 2 on load{which is fine} then scrolls to final page.

    Resolved (Going to try and create a loop to loop back to the start)
    [code]

    $(document).ready(function() {
    $('#tablemissing').dataTable({
    "bPaginate": true,
    "bAutoWidth":false
    });
    $('#tablefailed').dataTable({
    "bPaginate": true,
    "bAutoWidth":false
    });
    nextpage();
    function nextpage()
    {
    if($('#tablemissing_paginate').find('.paginate_disabled_next').length>0){
    $('#tablemissing_previous').trigger('click');
    $('#tablemissing_previous').trigger('click');
    $('#tablemissing_previous').trigger('click');
    $('#tablemissing_previous').trigger('click');
    $('#tablemissing_previous').trigger('click');
    $('#tablemissing_previous').trigger('click');
    $('#tablemissing_previous').trigger('click');
    $('#tablemissing_previous').trigger('click');
    $('#tablemissing_previous').trigger('click');
    $('#tablemissing_previous').trigger('click');
    }
    else
    $('#tablemissing_next').trigger('click');
    if($('#tablefailed_paginate').find('.paginate_disabled_next').length>0){
    $('#tablefailed_previous').trigger('click');
    $('#tablefailed_previous').trigger('click');
    $('#tablefailed_previous').trigger('click');
    $('#tablefailed_previous').trigger('click');
    $('#tablefailed_previous').trigger('click');
    $('#tablefailed_previous').trigger('click');
    $('#tablefailed_previous').trigger('click');
    $('#tablefailed_previous').trigger('click');
    $('#tablefailed_previous').trigger('click');
    $('#tablefailed_previous').trigger('click');
    }
    else
    $('#tablefail_next').trigger('click');
    setTimeout( function()
    {
    nextpage();
    }, (60*1000));


    }
    } );

    [/code]

    I've posted this as I think this may come in useful for more than just me. Also it is a web Reference for myself.
This discussion has been closed.