1//JAW-SLIDER 2(function($) { 3 4 'use_strict'; 5 /** * JaW Slider 6 * @param {type} options 7 */ 8 $.fn.jawSlider = function(options) { 9 var options = options || {}; 10 11 return $(this).each(function() { 12 13 var defaults = { 14 animationSpeed: 1500, 15 animationDelay: '3000', 16 animationStep: 489, 17 animationDirection: 'left', 18 bulletsSelector: '.bullet_row', 19 itemsPerScreen: 1, 20 externalSlide: false 21 }; 22 options = $.extend({}, defaults, options); 23 24 25 var $slider = jQuery(this); 26 var timeout; 27 var mouseout = true; 28 var slide = function(length, direction) { 29 var i = 0; 30 if (length === undefined) { 31 length = 1; 32 } 33 34 if (direction === undefined) { 35 direction = options.animationDirection; 36 } 37 38 39 if (direction == 'left') { 40 41 for (i = 0; i < length; i++) { 42 $slider.find('.jaw_slider_row').append($slider.find('.jaw_one_slide').eq(i).clone()); 43 } 44 45 $slider.find('.jaw_slider_row').animate({left: '-=' + options.animationStep * length + 'px'}, options.animationSpeed, 'easeInOutQuint', function() { 46 47 clearTimeout(timeout); 48 $slider.find('.jaw_slider_row').css('left', '+=' + options.animationStep * length + 'px'); 49 for (i = 0; i < length; i++) { 50 $slider.find('.jaw_one_slide').first().remove(); 51 } 52 $slider.find('.jaw_one_slide').eq(2).find('.jaw_content').animate({bottom: '0'}, options.animationSpeed); 53 $slider.find('.jaw_one_slide').removeClass('prev active next'); 54 $slider.find('.jaw_one_slide').eq(1).addClass('prev'); 55 $slider.find('.jaw_one_slide').eq(2).addClass('active'); 56 $slider.find('.jaw_one_slide').eq(3).addClass('next'); 57 $slider.find('.bullet i').removeClass('active'); 58 $slider.find('.bullet').eq(Number($slider.find('.jaw_one_slide').eq(2).attr('data-sld'))).addClass('active'); 59 if (mouseout) { 60 startSlide(); 61 } 62 63 64 // }); 65 }); 66 } else { //OTACENI vpravo 67 68 for (i = $slider.find('.jaw_one_slide').length - 1; i > $slider.find('.jaw_one_slide').length - 1 - length; i--) { 69 $slider.find('.jaw_slider_row').prepend($slider.find('.jaw_one_slide').eq(i).clone()); 70 } 71 72 $slider.find('.jaw_one_slide').find('.jaw_content').animate({bottom: '-185px'}, options.animationSpeed); 73 $slider.find('.jaw_slider_row').css('left', '-=' + options.animationStep * length + 'px'); 74 $slider.find('.jaw_slider_row').animate({left: '+=' + options.animationStep * length + 'px'}, options.animationSpeed, 'easeInOutQuint', function() { 75 76 clearTimeout(timeout); 77 for (i = 0; i < length; i++) { 78 $slider.find('.jaw_one_slide').last().remove(); 79 } 80 $slider.find('.jaw_one_slide').eq(2).find('.jaw_content').animate({bottom: '0'}, options.animationSpeed); 81 $slider.find('.jaw_one_slide').removeClass('prev active next'); 82 $slider.find('.jaw_one_slide').eq(1).addClass('prev'); 83 $slider.find('.jaw_one_slide').eq(2).addClass('active'); 84 $slider.find('.jaw_one_slide').eq(3).addClass('next'); 85 $slider.find('.bullet i').removeClass('icon-circle2'); 86 $slider.find('.bullet i').addClass('icon-radio-unchecked'); 87 $slider.find('.bullet').eq(Number($slider.find('.jaw_one_slide').eq(2).attr('data-sld'))).find('i').removeClass('icon-radio-unchecked'); 88 $slider.find('.bullet').eq(Number($slider.find('.jaw_one_slide').eq(2).attr('data-sld'))).find('i').addClass('icon-circle2'); 89 if (mouseout) { 90 startSlide(); 91 } 92 93 }); 94 } 95 96 }; 97 //Po spusteni slideru 98 var init = function() { 99 $slider.show(); 100 slide(1); 101 startSlide(); 102 }; 103 init(); 104 105 var startSlide = function(){ 106 timeout = setTimeout(slide, options.animationDelay); 107 } 108 109 110 111 $slider.find('.jaw_one_slide').width($slider.width()/options.itemsPerScreen); 112 113 114 //po najeti zastavit animaci 115 $slider.mouseenter(function() { 116 clearTimeout(timeout); 117 mouseout = false;
118 }); 119 $slider.mouseleave(function() { 120 mouseout = true; 121 startSlide(); 122 }); 123 /********************************** UI **********************************/ 124 125 //Kliknutà na navigaÄnà sipky 126 $slider.find(options.bulletsSelector).find('.bull').on('click', function() { 127 clearTimeout(timeout); 128 if (jQuery(this).attr('data-sld') === undefined) { 129 if (jQuery(this).attr('data-direction') == 'left') { 130 slide(1); 131 } else { 132 slide(1, 'right'); 133 } 134 } else { 135 if (jQuery(this).attr('data-sld') != $slider.find('.jaw_one_slide').eq(2).attr('data-sld')) { 136 var cross_zero = 0; 137 if (jQuery(this).attr('data-sld') < $slider.find('.jaw_one_slide').eq(2).attr('data-sld')) { 138 cross_zero = 1; 139 } 140 var calltime = cross_zero * ($slider.find('.jaw_one_slide').length) - Number($slider.find('.jaw_one_slide').eq(2).attr('data-sld')) + Number(jQuery(this).attr('data-sld')); 141 slide(calltime); 142 } 143 } 144 }); 145 }); 146 147 }; 148})(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.