1/** 2 * Jarallax initialization for Gullström & CO Bricks sites. 3 * 4 * Loaded deferred with "jarallax" declared as a dependency, so WordPress 5 * guarantees this runs after the library and neither script blocks first paint. 6 * Because the script is deferred, the DOM is already parsed when this executes. 7 */ 8(function () { 9 if (typeof jarallax !== "function") { 10 return; 11 } 12 13 document.querySelectorAll(".jarallax").forEach(function (el) { 14 // Read the object-position Bricks applied to this image so Jarallax 15 // writes that value back instead of overwriting it with its 50% 50% 16 // default. Must happen before jarallax() touches the element. 17 var img = el.querySelector(".jarallax-img") || el.querySelector("img"); 18 var imgPosition = img ? getComputedStyle(img).objectPosition : "50% 50%"; 19 20 jarallax(el, { 21 // Default scroll speed. Override per section in Bricks with data-speed="0.3". 22 // Values below 1 move slower than the scroll (classic parallax). 23 speed: 0.5, 24 // Per-image position, pulled from the Bricks-generated CSS above. 25 imgPosition: imgPosition, 26 // Disable the transform parallax on touch devices to avoid the iOS jump. 27 // Jarallax falls back to a normal cover image automatically. 28 disableParallax: /iPad|iPhone|iPod|Android/, 29 }); 30 }); 31})();
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.