제이쿼리 이미지 사이즈 구하기 채택완료
트루헤일
12개월 전
조회 1,166
아래 예제로 하면 업로드된 업로드 이미지 사이즈가 나오더라고요
저는 화면에 보이는 리사이징된 값을 구하고 싶은데 방법이 없을까요?
</strong>var img = $("#map"); // Get my img elem
var pic_real_width, pic_real_height;
$("<img/>") // Make in memory copy of image to avoid css issues
.attr("src", $(img).attr("src"))
.load(function() {
pic_real_width = this.width ; // Note: $(this).width() will not
pic_real_height = this.height ; // work for in memory images.
alert( '' + pic_real_width + ',' + pic_real_height )
});<strong>
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인