国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

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

2019-11-20 12:51:41
字體:
供稿:網(wǎng)友

本文實(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ì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 永修县| 梅州市| 腾冲县| 哈密市| 达日县| 长宁县| 大埔县| 东港市| 措美县| 汝阳县| 奈曼旗| 翁源县| 承德市| 屯留县| 鞍山市| 长汀县| 本溪市| 惠水县| 高陵县| 漳平市| 扎鲁特旗| 新闻| 泰安市| 通州区| 清远市| 平顺县| 德惠市| 正阳县| 纳雍县| 德钦县| 贵港市| 娄底市| 定陶县| 海阳市| 广东省| 开化县| 永仁县| 新乐市| 扶余县| 武宣县| 昌宁县|