1 $ = jQuery.noConflict(); 2 3 $(function(){ 4 var $elems = $('.animateblock'); 5 var winheight = $(window).height(); 6 var fullheight = $(document).height(); 7 8 $(window).scroll(function(){ 9 animate_elems(); 10 }); 11 12 function animate_elems() { 13 wintop = $(window).scrollTop(); // calculate distance from top of window 14 15 // loop through each item to check when it animates 16 $elems.each(function(){ 17 $elm = $(this); 18 19 if($elm.hasClass('animated')) { return true; } // if already animated skip to the next item 20 21 topcoords = $elm.offset().top; // element's distance from top of page in pixels 22 23 if(wintop > (topcoords - (winheight*.75))) { 24 // animate when top of the window is 3/4 above the element 25 $elm.addClass('animated'); 26 } 27 }); 28 } // end animate_elems() 29 });
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.