Home › Forums › JavaScript › Hide previous arrow on first slide (and next on last one) using "appendBackTo" › Reply To: Hide previous arrow on first slide (and next on last one) using "appendBackTo"
September 19, 2013 at 3:45 pm
#150640
lambdaka
Participant
found the solution here :
http://stackoverflow.com/questions/15155377/how-to-disable-anythingslider-forward-button-onlast-slide-and-back-button-on-fir
Use the following code
$('#slider').anythingSlider({
onInitialized : function(){
// hide back arrow
$('.arrow.back').hide();
},
onSlideComplete : function(){
if($('#slider .panel:not(.cloned)').first().hasClass('activePage')){
// hide back arrow
$('.arrow.back').hide();
}
else{
$('.arrow.back').show();
}
if($('#slider .panel:not(.cloned)').last().hasClass('activePage')){
// hide forward arrow
$('.arrow.forward').hide();
}
else{
$('.arrow.forward').show();
}
}
});