最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery獲得包含margin的outerWidth和outerHeight的方法

 更新時間:2015年03月25日 16:13:16   作者:上大王  
這篇文章主要介紹了jQuery獲得包含margin的outerWidth和outerHeight的方法,涉及jQuery中outerWidth及outerHeight方法的使用技巧,具有一定參考借鑒價值,需要的朋友可以參考下

本文實例講述了jQuery獲得包含margin的outerWidth和outerHeight的方法。分享給大家供大家參考。具體如下:

<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.min.js">
</script>
<script>
$(document).ready(function(){
 $("button").click(function(){
  var txt="";
  txt+="Width of div: " + $("#div1").width() + "</br>";
  txt+="Height of div: " + $("#div1").height() + "</br>";
  txt+="Outer width of div (margin included): " + $("#div1").outerWidth(true) + "</br>";
  txt+="Outer height of div (margin included): " + $("#div1").outerHeight(true);
  $("#div1").html(txt);
 });
});
</script>
</head>
<body>
<div id="div1" style="height:100px;width:300px;padding:10px;margin:3px;border:1px solid blue;background-color:lightblue;">
</div>
<br>
<button>Display dimensions of div</button>
<p>outerWidth(true) - returns the width of an element (includes padding, border, and margin).</p>
<p>outerHeight(true) - returns the height of an element (includes padding, border, and margin).</p>
</body>
</html>

希望本文所述對大家的jQuery程序設(shè)計有所幫助。

相關(guān)文章

最新評論

凭祥市| 中卫市| 承德市| 丹阳市| 长春市| 东港市| 睢宁县| 梁山县| 历史| 西丰县| 兴化市| 铁岭县| 英超| 横山县| 平山县| 寿阳县| 玛纳斯县| 射阳县| 大宁县| 洛扎县| 永新县| 梧州市| 吴江市| 平泉县| 淮阳县| 楚雄市| 绥棱县| 韩城市| 汉阴县| 宿松县| 丹棱县| 平山县| 玉山县| 洪江市| 象山县| 施甸县| 兰西县| 登封市| 郁南县| 屯昌县| 新源县|