Created
January 17, 2013 18:18
-
-
Save redstar504/4558185 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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