<img src="xxx.jpg" onclick=how_size(this) title=이미지크기는얼마일까요 style=cursor:pointer>
<script language=javascript>
function get_image_size(id) {
    img = document.body.appendChild(document.createElement('img'))
    img.src = id.src;
    var w = img.offsetWidth;
    var h = img.offsetHeight;
    document.body.removeChild(img);
    return {width:w,height:h};
}
function how_size(img) {
    var size = get_image_size(img);
    alert('width:'+size.width+',height:'+size.height);
}
</script>
2007/11/22 15:15 2007/11/22 15:15

Trackback Address :: 이 글에는 트랙백을 보낼 수 없습니다