Skip to content

Instantly share code, notes, and snippets.

@redstar504
Created January 17, 2013 18:18
Show Gist options
  • Save redstar504/4558185 to your computer and use it in GitHub Desktop.
Save redstar504/4558185 to your computer and use it in GitHub Desktop.
$(function() {
$(document).on('click','.yiiPager a', function(e) {
e.preventDefault();
var userId = $(this).data('user');
var url = $(this).attr('href');
jQuery.ajax({
'dataType' : 'json',
'success' : function(data) {
$('#reviewListing').html(data.reviews); // refill content with ajax response
$('html, body').animate({ // scroll to top of #reviewListing div
scrollTop: $("#reviewListing").offset().top
}, 500);
},
'url' : url
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment