1// Detect objectFit support 2if(('objectFit' in document.documentElement.style === false) || (navigator.userAgent.indexOf('Edge') >= 0)) { 3 4 // assign HTMLCollection with parents of images with objectFit to variable 5 var container = document.getElementsByClassName('news-box-bild'); 6 7 // Loop through HTMLCollection 8 for(var i = 0; i < container.length; i++) { 9 // Asign image source to variable 10 var imageSource = container[i].querySelector('img').src; 11 // Hide image 12 container[i].querySelector('img').style.display = 'none'; 13 // Add background-size: cover 14 container[i].style.backgroundSize = 'cover'; 15 // Add background-image: and put image source here 16 container[i].style.backgroundImage = 'url(' + imageSource + ')'; 17 // Add background-position: center center 18 container[i].style.backgroundPosition = 'center center'; 19 } 20} 21else { 22 // You don't have to worry 23 // console.log('No worries, your browser supports objectFit') 24}
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.