当我使用jquery分页单击后退按钮时,如何在分页中获取当前页面

时间:2014-06-25 13:21:31

标签: javascript jquery pagination

当我点击后退按钮时,我希望获得当前页面的分页。泰语后退按钮将在消息页面中,任何人都可以帮我解决此问题。

这是我的代码

var maxRows = 10;

$('.pagination_table').each(function() {
    var cTable = $(this);
    var cRows = cTable.find('tr:gt(0)');

    var cRowCount = cRows.size();
    $('#total_cnt').html(cRowCount)
    if (cRowCount < maxRows) {
        $('#right_cnt').html(cRowCount)
    }
    if (cRowCount < maxRows) {
        return;
    }
    cRows.filter(':gt(' + (maxRows - 1) + ')').hide();


    var cPrev = cTable.find('#page_left');
    var cNext = cTable.find('#page_right');

    cPrev.addClass('disabled');

    $(document).delegate('#page_left', 'click', function() {
        var cFirstVisible = cRows.index(cRows.filter(':visible'));
        // alert(cFirstVisible-9);
        if (cFirstVisible > 0) {
            var prev_count = cFirstVisible - 9;
            $('#left_cnt').html(prev_count)
            var next_count = cFirstVisible;
            $('#right_cnt').html(next_count)
         } else { }
         if (cPrev.hasClass('disabled')) {
             return false;
         }

         cRows.hide();
         if (cFirstVisible - maxRows - 1 > 0) {
             cRows.filter(':lt(' + cFirstVisible + '):gt(' + (cFirstVisible - maxRows - 1) + ')').show();
         } else {
             cRows.filter(':lt(' + cFirstVisible + ')').show();
         }

         if (cFirstVisible - maxRows <= 0) {
             cPrev.addClass('disabled');
         }

         cNext.removeClass('disabled');
         return false;
     });

0 个答案:

没有答案