1 2$(function () { 3 4 var $body = $('body'), 5 $slides = $('.js-slide'), 6 totalSlides = $slides.length, 7 slidePosition = 0; 8 9 if (totalSlides > 1) { 10 bannerShowSlide(slidePosition); 11 } 12 13 $body.delegate('.js-slide-prev', 'click', function(event) { 14 event.preventDefault(); 15 16 if (slidePosition == 0) { 17 slidePosition = totalSlides - 1; 18 } 19 else { 20 slidePosition = slidePosition - 1; 21 } 22 bannerShowSlide(slidePosition); 23 24 return false; 25 }); 26 27 $body.delegate('.js-slide-next', 'click', function (event) { 28 event.preventDefault(); 29 30 if (slidePosition < (totalSlides - 1)) { 31 slidePosition = slidePosition + 1; 32 } 33 else { 34 slidePosition = 0; 35 } 36 bannerShowSlide(slidePosition); 37 38 return false; 39 }); 40 41}); 42 43function bannerShowSlide(slidePosition) { 44 var $slides = $('.js-slide'); 45 $slides.removeClass('is-visible'); 46 $slides.eq(slidePosition).addClass('is-visible'); 47}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.