썸네일생성 후 지정 이미지 사이즈 유지되지 않는 오류 수정

This commit is contained in:
chicpro
2013-12-13 09:27:39 +09:00
parent a2e6ba132d
commit 6a344d1438
2 changed files with 11 additions and 7 deletions

View File

@ -21,16 +21,20 @@
var width = $this.width();
$img.each(function() {
$(this).removeAttr("width")
.removeAttr("height")
.css("width","")
.css("height", "");
if($(this).data("width") == undefined)
$(this).data("width", $(this).width());
if($(this).data("width") > width) {
$(this).css("width", "100%");
$(this).removeAttr("width")
.removeAttr("height")
.css("width","")
.css("height", "");
if($(this).data("width") > width) {
$(this).css("width", "100%");
}
} else {
$(this).attr("width", $(this).data("width"));
}
});
}