Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery slide Re: jQuery slide

#75897
Mottie
Member

I think I understand now.

I think you might need to target the `section.content` instead of `#ajax` because the content includes the pagination and if you get that, you can determine if there are more pages from `l-arrow` and `r-arrow` (which don’t seem to be updating on the main page). So try something like this:

var ajax = $(‘#ajax’),
result, link;
$(‘section.content’).asfar({
selector : ‘.r-arrow, .l-arrow’,
insert : function(urlFragment,target,data){
ajax.hide(“slide”, { direction: “left” }, 500, function(){
result = $(data);
$(target).html(data);
ajax.show(“slide”, { direction: “right” }, 500);
// update navigation arrows
link = result.find(‘.l-arrow’).attr(‘href’) || ”;
$(‘.l-arrow’).attr(‘href’, link).toggleClass(‘active’, link !== ”);
link = result.find(‘.l-arrow’).attr(‘href) || ”;
$(‘.r-arrow’).attr(‘href’, link).toggleClass(‘active’, link !== ”);
});
},
success : function(urlFragment,target){
_gaq.push();
}
});

I haven’t tested it, but hopefully it will help.