柚子快報邀請碼778899分享:excel jQuery 尺寸
Starday星光購物棧綜合2025-05-05220
柚子快報邀請碼778899分享:excel jQuery 尺寸
jQuery?尺寸
通過 jQuery,很容易處理元素和瀏覽器窗口的尺寸。
jQuery 尺寸方法
jQuery 提供多個處理尺寸的重要方法:
width()height()innerWidth()innerHeight()outerWidth()outerHeight()
jQuery 尺寸
jQuery width() 和 height() 方法
width() 方法設(shè)置或返回元素的寬度(不包括內(nèi)邊距、邊框或外邊距)。
height() 方法設(shè)置或返回元素的高度(不包括內(nèi)邊距、邊框或外邊距)。
下面的例子返回指定的
元素的寬度和高度:
實例
$("button").click(function(){ var txt=""; txt+="div 的寬度是: " + $("#div1").width() + ""; txt+="div 的高度是: " + $("#div1").height(); $("#div1").html(txt); });
柚子快報邀請碼778899分享:excel jQuery 尺寸
精彩鏈接
評論可見,查看隱藏內(nèi)容
本文內(nèi)容根據(jù)網(wǎng)絡(luò)資料整理,出于傳遞更多信息之目的,不代表金鑰匙跨境贊同其觀點和立場。
轉(zhuǎn)載請注明,如有侵權(quán),聯(lián)系刪除。