yujiokayama
7/18/2018 - 11:19 AM

lazyloadでアンカーの位置がずれる

window.addEventListener('load', function() {
 const imgs = document.querySelectorAll('article img');
 imgs.forEach(function (ele) {
    const imgHeight = ele.getAttribute('height');
    ele.setAttribute('style','max-height:' + imgHeight +'px;');
  });
});