开发者

Problem with jQuery pagination and putting an animate.?

Question 1: Why not change pagination after click (pagination page change but it no)?

I mean is here in my example (this not change after click):

Problem with jQuery pagination and putting an animate.?

EXAMPLE: My code

Question 2: I want putting an animate like this for pagination ta开发者_StackOverflowble but stronger: http://jsfiddle.net/wY3Us/3/

Js code:

$('#pagination a').live('click', function(e) {
    e.preventDefault();
        $.get( $(this).attr('href'), function(html) {
            $('table#paginate').replaceWith( $(html).find('table#paginate') );
        });
        return false;
    });

With respect


Change your javascript to this:

$('#pagination a').live('click', function(e) {
    e.preventDefault();
        $.get( $(this).attr('href'), function(html) {
            $('table#paginate').replaceWith( $(html).find('table#paginate') );
        });
        return false;
    $('.pagination a').removeClass('selected');
    $(this).addClass('selected');
    });

And your html should look like this:

<div class="pagination">

 <a class="selected" href="http://www.binboy.gigfa.com/admin/hotel/show/1">1</a>&nbsp;
    <a href="http://www.binboy.gigfa.com/admin/hotel/show/3">2</a>&nbsp;
    <a href="http://www.binboy.gigfa.com/admin/hotel/show/6">3</a>&nbsp;
    <a href="http://www.binboy.gigfa.com/admin/hotel/show/3">&gt;</a>
     &nbsp;&nbsp;
    <a href="http://www.binboy.gigfa.com/admin/hotel/show/9">Last > </a>  
 </div>

And make sure you have the following lines in your CSS:

div.pagination a.selected {
    font-weight: bolder;
}

GoodLuck!


I think you are giving wrong ID, your pagination links are on #pagination div, try

$('#pagination').replaceWith( $(html).find('#pagination') );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜