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

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

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

本文實(shí)例講述了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>

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

相關(guān)文章

最新評(píng)論

开封市| 图木舒克市| 绥中县| 常熟市| 澄江县| 蒙山县| 缙云县| 瑞安市| 神农架林区| 韶关市| 五指山市| 巨鹿县| 承德市| 镇安县| 玛曲县| 阳新县| 黄石市| 黑龙江省| 稷山县| 独山县| 栖霞市| 固安县| 杭锦后旗| 浪卡子县| 扶风县| 汝州市| 峨边| 古丈县| 贵南县| 五峰| 福贡县| 庆云县| 车致| 武穴市| 宝鸡市| 武乡县| 张家界市| 上饶县| 太谷县| 平阳县| 政和县|