国产gaysexchina男同gay,japanrcep老熟妇乱子伦视频,吃奶呻吟打开双腿做受动态图,成人色网站,国产av一区二区三区最新精品

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>