[英]better way to jQuery set outerWidth(true) - width
簡而言之,有沒有辦法設置outerWidth?
$.outerWidth(true, newValue)
更新:我找到了一些這樣做的插件,雖然我需要一個功能定義而不是3個插件才能做到這一點。
這是你在找什么?
var a = $('element');
actualWidth = a.outerWidth(true),
desiredWidth = 1000,
difference = desiredWidth - actualWidth,
a.css('width',difference);
如果要設置元素的寬度,可以使用這些示例
var a = $("#element");
a.width(10);
a.css("width", "10px");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.