1/** 2 * k-web 3 * */ 4 5(function($) { 6 var TCK_Animations = function(container, options) { 7 var defaults = { 8 replay: '0' // replay animations 9 }; 10 11 var opts = $.extend(defaults, options); 12 var els = $(container); 13 var $window = $(window); 14 15 els.each(function() { 16 var $this = $(this); 17 $window = $(window); 18 19 // function to be called whenever the window is scrolled or resized 20 function update($this){ 21 var top = $this.offset().top; 22 var pos = $window.scrollTop(); 23 var height = $this.height(); 24 var windowheight = $(window).height(); 25 26 // check if totally above or totally below viewport 27 if (top + height < pos || top > pos + windowheight) { 28 if (opts.replay == '1') $this.removeClass('animateck'); 29 return; 30 } 31 // animate the content if found 32 if (top < pos || top > pos + windowheight-30) { 33 // is out of the screen 34 } else { 35 $this.addClass('animateck'); 36 } 37 } 38 update($this); 39 $window.bind('load scroll', function() { update($this); }); 40 // $window.scroll(function() { update($this); }); 41 }); 42 }; 43 window.TCK_Animations = TCK_Animations; 44})(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.