1(function($) { 2 $('.nav-toggler').click(function() { 3 $('.nav-more').slideToggle('300'); 4 $(this).toggleClass('active'); 5 }); 6 $('.gallery').photobox('a'); 7 //multiple recaptcha on same page 8 $('.ginput_recaptcha').each(function(i) { 9 var thisID = $(this).attr('id'); 10 $(this).attr('id', thisID + '_' + i); 11 }); 12 13 function verticalSlider() { 14 if ($('.vertical-slider')) { 15 var slider = $('.vertical-slider'); 16 var items = $('.vertical-slider .items'); 17 var item = $('.vertical-slider .item'); 18 var itemsToShow = slider.data('slides'); 19 20 if (window.innerWidth <= 767) { 21 var itemsToShow = 1; 22 } 23 var firstItem = 0; 24 var lastItem = item.length; 25 if (!slider.data('slide')) { 26 slider.data('slide', 0); 27 } 28 var currentItem = slider.data('slide'); 29 isFirstOrLastItem(); 30 var maxHeight = Math.max.apply(null, item.map(function() { 31 return $(this).outerHeight(); 32 }).get()); 33 $(window).on('load', function() { 34 maxHeight = Math.max.apply(null, item.map(function() { 35 return $(this).outerHeight(); 36 }).get()); 37 items.css('transform', 'translateY(-' + ((currentItem) * maxHeight) + 'px)'); 38 item.css('height', maxHeight); 39 slider.css('max-height', itemsToShow * maxHeight); 40 }); 41 42 $(window).resize(function() { 43 if (window.innerWidth <= 767) { 44 itemsToShow = 1; 45 } 46 item.css('height', 'auto'); 47 slider.css('max-height', 'auto'); 48 maxHeight = Math.max.apply(null, item.map(function() { 49 return $(this).outerHeight(); 50 }).get()); 51 item.css('height', maxHeight); 52 slider.css('max-height', itemsToShow * maxHeight); 53 currentItem = slider.data('slide'); 54 items.css('transform', 'translateY(-' + ((currentItem) * maxHeight) + 'px)'); 55 }); 56 57 function slideNext() { 58 currentItem = slider.data('slide'); 59 if (currentItem != lastItem - itemsToShow) { 60 items.css('transform', 'translateY(-' + ((currentItem + 1) * maxHeight) + 'px)'); 61 slider.data('slide', slider.data('slide') + 1); 62 } 63 isFirstOrLastItem(); 64 } 65 66 function slidePrev() { 67 currentItem = slider.data('slide'); 68 if (currentItem != firstItem) { 69 items.css('transform', 'translateY(-' + ((currentItem - 1) * maxHeight) + 'px)'); 70 slider.data('slide', slider.data('slide') - 1); 71 } 72 isFirstOrLastItem(); 73 } 74 75 function isFirstOrLastItem() { 76 currentItem = slider.data('slide'); 77 if (lastItem == itemsToShow) { 78 slider.addClass('first'); 79 slider.addClass('last'); 80 } else if (currentItem == firstItem) { 81 slider.addClass('first'); 82 slider.removeClass('last'); 83 } else if (currentItem == lastItem - itemsToShow) { 84 slider.addClass('last'); 85 slider.removeClass('first'); 86 } else { 87 slider.removeClass('first last'); 88 } 89 } 90 $('.vertical-slider .next').click(function() { 91 slideNext(); 92 }); 93 94 $('.vertical-slider .prev').click(function() { 95 slidePrev(); 96 }); 97 } 98 } 99 verticalSlider(); 100})(jQuery);
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.