$('.m-scooch').scooch();

if ( $('.m-item:first-child' ).hasClass('m-active') ) {
    $('.m-scooch-controls [data-m-slide="prev"]').addClass('hide');
};

$('.m-scooch-controls a').click(function() {
    $('.m-scooch-controls a').removeClass('hide');

    if ( $('.m-item:first-child' ).hasClass('m-active') ) {
        $('.m-scooch-controls [data-m-slide="prev"]').addClass('hide');
    };

    if ( $('.m-item:last-child' ).hasClass('m-active') ) {
        $('.m-scooch-controls [data-m-slide="next"]').addClass('hide');
    };

});


// Pseusocode
//
// Create array of images in carousel
// var images = $('.m-item').map(function() {
//      return this
// }).get();
//
// when the afterSlide event fires
//
//     make sure to reevaluate the situation, adding buttons back that were previously removed
//
//     for image in images
//         if !image[i-1]
//             add hide class to previous button
//         if !image[i+1]
//             add hide class to next button
//

@@ -163,41 +163,69 @@
 ooch
--controls a').click(function(
+').on('afterSlide', function(e, previousSlide, nextSlide
 ) %7B%0A
+%0A
     
@@ -554,460 +554,8 @@
  %7D;%0A
-%0A
 %7D);%0A
-%0A%0A// Pseusocode%0A//%0A// Create array of images in carousel%0A// var images = $('.m-item').map(function() %7B%0A//      return this%0A// %7D).get();%0A//%0A// when the afterSlide event fires%0A//%0A//     make sure to reevaluate the situation, adding buttons back that were previously removed%0A//%0A//     for image in images%0A//         if !image%5Bi-1%5D%0A//             add hide class to previous button%0A//         if !image%5Bi+1%5D%0A//             add hide class to next button%0A//%0A

Fix for scooch carousel next/prev buttons