1$(document).ready(function(){ 2 // cache the window object 3 $window = $(window); 4 5 $('section[data-type="background"]').each(function(){ 6 // declare the variable to affect the defined data-type 7 var $scroll = $(this); 8 9 $(window).scroll(function() { 10 // HTML5 proves useful for helping with creating JS functions! 11 // also, negative value because we're scrolling upwards 12 var yPos = -($window.scrollTop() / $scroll.data('speed')); 13 14 // background position 15 var coords = '50% '+ yPos + 'px'; 16 17 // move the background 18 $scroll.css({ backgroundPosition: coords }); 19 }); // end window scroll 20 }); // end section function 21}); // close out script 22 23/* Create HTML5 element for IE */ 24document.createElement("section");
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.