[英]How to get element width/height with margin, padding, border in Native JavaScript (no jQuery)
[英]How to get the width of padding, border, and margins of an element
目前,我正在做一些非常討厭的計算,以獲取<select>
元素的實際寬度。 它具有邊框,內邊距,邊距等。jQuery的externalWidth()-innerWidth()不能給我幾乎我想要的東西。 有人遇到過這種問題嗎? 似乎實際上是很普遍的。
試試這個jQuery插件 ,它將允許您獲取元素的計算出的CSS並可能有助於解決問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.