Question 1: Why not change pagination after click
(pagination page change but it no)?
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>
<a href="http://www.binboy.gigfa.com/admin/hotel/show/3">2</a>
<a href="http://www.binboy.gigfa.com/admin/hotel/show/6">3</a>
<a href="http://www.binboy.gigfa.com/admin/hotel/show/3">></a>
<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') );
精彩评论