I need a click on the .next button in jQuery serialScroll/scrollTo to not only slide to the next item but to make an ajax call for new content before doing so. What is the best way to get an ajax call onto the .next button in serialScroll?
Here's the serialScroll stuff;
$('.audioholder').serialScroll({
target:'.scrollable',
items:'.newthing',
prev:'img.prev',
next:'img.next',
cycle:false,
axis:'x',
duration:700,
force:true,
lazy:true,
});
And the ajax code:
var target = $(this).closest('.newthing').next('.newthing');
var toLoad = Drupal.settings.basePath + 'replies/' + mynid;
xhr = $.ajax({
url: toLoad,
success: function(data) {
$(target).html(data);
});
return false;