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

#122892
chrisburton
Participant

I’m so close!!! The only problem I have now is when clicking the left-arrow, it should slide in the opposite direction.

Also, I would prefer that when there are no more pages to scroll through, the slide doesn’t cycle.

$(‘#ajax’).asfar({
selector : ‘.r-arrow, .l-arrow’,
before : function(urlFragment,target){
console.log(‘before’);
},
insert : function(urlFragment,target,data){
$(target).hide(“slide”, { direction: “left” }, 500, function(){
$(target).html(data);
$(target).show(“slide”, { direction: “right” }, 500);
});
},
after : function(urlFragment,target){
console.log(‘after’);
},
success : function(urlFragment,target){
if(0 > $(‘a[href=”‘ + urlFragment + ‘”]’).length){
$(‘a’).removeClass(‘active’);
$(‘a[href=”‘ + urlFragment + ‘”]’).addClass(‘active’);
}
_gaq.push();
}
});