Forums

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

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"

#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();
            }
        }
    });