1(function ($) { 2 // Check if the section has the parallax class. 3 if ($('.parallax-section').length) { 4 var parallaxItem = $('.parallax-section'), 5 // IE 11 => return version number 6 isIE11 = !!navigator.userAgent.match(/Trident\/7\./); 7 $.browser.device = (/Android|iPad|iPhone|iPod|BlackBerry|Windows Phone|opera mini|iemobile/i.test(navigator.userAgent || navigator.vendor || window.opera)); 8 9 // Check if the browser is IE10 or below. 10 if ($.browser.msie || isIE11 > 0 || $.browser.device) { 11 // Remove the parallax scrolling styles and center background image vertically. 12 parallaxItem.css({ 13 backgroundAttachment: 'scroll', 14 backgroundPosition: '50% 50%' 15 }); 16 } 17 else { 18 parallaxItem.addClass('parallax-started'); 19 } 20 } 21 22 $(document).ready(function () { 23 // Cache the Window object 24 $window = $(window); 25 26 $('.parallax-started').each(function () { 27 // assigning the object 28 var $bgobj = $(this), 29 parallaxSpeed = $bgobj.data('parallax-background-speed'); 30 31 $(window).scroll(function () { 32 // Scroll the background at var speed 33 // the yPos is a negative value because we're scrolling it UP! 34 var yPos = -(($(window).scrollTop() - $bgobj.offset().top) / parallaxSpeed); 35 36 // Put together our final background position 37 var coords = '50% ' + yPos + 'px'; 38 39 // Move the background 40 $bgobj.css({backgroundPosition: coords}); 41 }); 42 // window scroll Ends 43 }); 44 }); 45})(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.