Javascript ~ get image size

var newImg = new Image();
newImg.src = 'http://www.google.com.tw/intl/en_com/images/srpr/logo1w.png';
var height = newImg.height;
var width = newImg.width;
alert ('The image size is '+width+'*'+height);


source
http://www.webdeveloper.com/forum/archive/index.php/t-98502.html

沒有留言: