国产chinesehdxxxx野外,国产av无码专区亚洲av琪琪,播放男人添女人下边视频,成人国产精品一区二区免费看,chinese丰满人妻videos

App下載
首頁(yè)javascriptwidthjQuery Style - 如何獲取元素寬度和高度

jQuery Style - 如何獲取元素寬度和高度

我們想知道如何獲取元素寬度和高度。

<!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(){
    var $img = $('.foo')
    var $width = $img.width();
    var $height = $img.height();
    console.log($width );
    console.log($height);
});
</script>
</head>
<body>
  <div class='foo'>foo</div>
</body>
</html>