首页javascriptimgjQuery HTML Element - 如何获得图像的本机高度...

jQuery HTML Element - 如何获得图像的本机高度...

我们想知道如何获得图像的本机高度。...

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-2.0.2.js'></script>
<script type='text/javascript'>
$(window).load(function(){
    $('img.change').click(function () {
        var self = this;
        $(self).attr('src', "http://www.w3cschool.cn/style/download.png");
        setTimeout(function () {
            $(self).attr('src', "http://w3cschool.cn/style/demo/Firefox.png");
        }, 2000)
    });
});
</script>
</head>
<body>
  <img class="change" src="http://w3cschool.cn/style/demo/Firefox.png" />
</body>
</html>