我想获得的图像的实际宽度...这里是有问题的jQuery - 获得图像的宽度
<img src="upload/<?php echo $array['image'] ?>" height="200" class="active" />
形象,这是我在jQuery的
$(window).bind('load', function() {
var img_width = $("#slideshow").find("img").width();
$("#slideshow img").css("width", img_width);
alert(img_width);
});
尝试
警报返回255每次我有试过这个图像,这是div幻灯片的宽度。这些图像的高度都为200,他们将有不同的宽度,我的问题是,如何获得这些宽度?
感谢, Ĵ
检查,这可能已经回答不已:http://stackoverflow.com/questions/2395931/how-do-i-get-actual-image-width-and-height-using-jquery – sakhunzai 2012-04-04 18:22:39