이미지 태그에 loading=lazy 가 있을경우 viewimagereisze 함수에서 width 속성을 추가하지 않도록 수정#355

This commit is contained in:
thisgun
2025-03-14 16:40:26 +09:00
parent e5128bf02e
commit 918ad48675

View File

@ -24,6 +24,9 @@
var width = $this.width(); var width = $this.width();
$img.each(function() { $img.each(function() {
if ($(this).attr("loading") === "lazy") return; // loading="lazy" 속성이 있는 경우 건너뜀
if($(this).data("width") == undefined) if($(this).data("width") == undefined)
$(this).data("width", $(this).width()); $(this).data("width", $(this).width());
@ -73,6 +76,9 @@
var width = $this.width(); var width = $this.width();
$img.each(function() { $img.each(function() {
if ($(this).attr("loading") === "lazy") return; // loading="lazy" 속성이 있는 경우 건너뜀
$(this).removeAttr("width") $(this).removeAttr("width")
.removeAttr("height") .removeAttr("height")
.css("width","") .css("width","")