1var $animation_elements = $('.animation-element'); 2var $window = $(window); 3 4function check_if_in_view() { 5 var window_height = $window.height(); 6 var window_top_position = $window.scrollTop(); 7 var window_bottom_position = (window_top_position + window_height); 8 9 $.each($animation_elements, function() { 10 var $element = $(this); 11 var element_height = $element.outerHeight() -100; 12 var element_top_position = $element.offset().top; 13 var element_bottom_position = (element_top_position + element_height); 14 15 //check to see if this current container is within viewport 16 if ((element_bottom_position >= window_top_position) && 17 (element_top_position <= window_bottom_position)) { 18 $element.addClass('in-view'); 19 //commented out to stop animation from repeating } else { 20 //$element.removeClass('in-view'); 21 } 22 }); 23} 24 25$window.on('scroll resize', check_if_in_view); 26$window.trigger('scroll');
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.