1 2 3 4 5 6var navegadores = ""; 7 8if (navegadores = navigator.userAgent.toLowerCase().indexOf('op') > -1) { 9 10 $(document).ready(function(){ 11 $(document).on("scroll",function(){ 12 var image = $(".lazy-img img"); 13 url = image.data("url"); 14 image.attr("src", url); 15 }); 16 }); 17 18 [].forEach.call(document.querySelectorAll('img[data-src]'), function(img) { 19 img.setAttribute('src', img.getAttribute('data-src')); 20 img.onload = function() { 21 img.removeAttribute('data-src'); 22 }; 23 }); 24 25}else if (navegadores = navigator.userAgent.indexOf('Firefox') > -1) { 26 27 var resposta = document.querySelectorAll('img'); 28 // var videoNo = document.querySelector('video-flex img').src; 29 for(var i = 0; i < resposta.length; i++){ 30 var dataSrc = resposta[i].getAttribute('data-src'); 31 if(dataSrc != null){ 32 dataSrc = dataSrc.replace(".xjpg",".jpg"); 33 resposta[i].setAttribute('data-src', dataSrc); 34 35 } 36 }; 37 38 39 40 $(document).ready(function(){ 41 $(document).on("scroll",function(){ 42 var image = $(".lazy-img img"); 43 url = image.data("url"); 44 image.attr("src", url); 45 }); 46 }); 47 48 [].forEach.call(document.querySelectorAll('img[data-src]'), function(img) { 49 img.setAttribute('src', img.getAttribute('data-src')); 50 img.onload = function() { 51 img.removeAttribute('data-src'); 52 }; 53 }); 54 55}else if (navegadores = navigator.userAgent.indexOf('Chrome') > -1) { 56 57 var resposta = document.querySelectorAll('img'); 58 // var videoNo = document.querySelector('video-flex img').src; 59 for(var i = 0; i < resposta.length; i++){ 60 var dataSrc = resposta[i].getAttribute('data-src'); 61 62 63 64 if(dataSrc != null){ 65 66 dataSrc = dataSrc.replace(".jpg",".webp"); 67 dataSrc = dataSrc.replace(".xjpg",".jpg"); 68 resposta[i].setAttribute('data-src', dataSrc); 69 70 } 71 }; 72 73 74 75 let lazyImages = [...document.querySelectorAll('.lazy')] 76 let inAdvance = 300 77 function lazyLoad() { 78 lazyImages.forEach(image => { 79 if (image.offsetTop < window.innerHeight + window.pageYOffset + inAdvance) { 80 image.src = image.dataset.src 81 image.onload = () => image.classList.add('loaded') 82 } 83 }) 84 85 // if all loaded removeEventListener 86 } 87 lazyLoad() 88 document.addEventListener('scroll', function(){ 89 lazyLoad() 90 }); 91 92 93 94 95}else if (navegadores = navigator.userAgent.indexOf('Safari') > -1) { 96 97 98 99 100 var resposta = document.querySelectorAll('img'); 101 // var videoNo = document.querySelector('video-flex img').src; 102 for(var i = 0; i < resposta.length; i++){ 103 var dataSrc = resposta[i].getAttribute('data-src'); 104 if(dataSrc != null){ 105 dataSrc = dataSrc.replace(".xjpg",".jpg"); 106 resposta[i].setAttribute('data-src', dataSrc); 107 108 } 109 }; 110 111 $(document).ready(function(){ 112 $(document).on("scroll",function(){ 113 var image = $(".lazy-img img"); 114 url = image.data("url"); 115 image.attr("src", url); 116 }); 117 }); 118 119 [].forEach.call(document.querySelectorAll('img[data-src]'), function(img) { 120 img.setAttribute('src', img.getAttribute('data-src')); 121 img.onload = function() { 122 img.removeAttribute('data-src'); 123 }; 124 }); 125 126}else { 127 128 129 130 $(document).ready(function(){ 131 $(document).on("scroll",function(){ 132 var image = $(".lazy-img img"); 133 url = image.data("url"); 134 image.attr("src", url); 135 }); 136 }); 137 138 [].forEach.call(document.querySelectorAll('img[data-src]'), function(img) { 139 img.setAttribute('src', img.getAttribute('data-src')); 140 img.onload = function() { 141 img.removeAttribute('data-src'); 142 }; 143 }); 144 145} 146 147 148 149 150 151 152 153 154 155 156 157 158
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.