用法:
containment
默認:
false
將調整大小限製在指定元素或區域的範圍內。
支持多種類型:- Selector:可調整大小的元素將包含在選擇器找到的第一個元素的邊界框內。如果未找到任何元素,則不會設置包含。
- Element:可調整大小的元素將包含在該元素的邊界框內。
-
String:可能的值:
"parent"
和"document"
.
代碼示例:
使用指定的containment
選項初始化可調整大小:
$( ".selector" ).resizable({
containment: "parent"
});
初始化後獲取或設置containment
選項:
// Getter
var containment = $( ".selector" ).resizable( "option", "containment" );
// Setter
$( ".selector" ).resizable( "option", "containment", "parent" );
相關用法
- JQuery UI Resizable classes用法及代碼示例
- JQuery UI Resizable create( event, ui )用法及代碼示例
- JQuery UI Resizable cancel用法及代碼示例
- JQuery UI Resizable grid用法及代碼示例
- JQuery UI Resizable maxHeight用法及代碼示例
- JQuery UI Resizable maxWidth用法及代碼示例
- JQuery UI Resizable disable用法及代碼示例
- JQuery UI Resizable autoHide用法及代碼示例
- JQuery UI Resizable helper用法及代碼示例
- JQuery UI Resizable alsoResize用法及代碼示例
- JQuery UI Resizable animateEasing用法及代碼示例
- JQuery UI Resizable destroy用法及代碼示例
- JQuery UI Resizable animate用法及代碼示例
- JQuery UI Resizable disabled用法及代碼示例
- JQuery UI Resizable instance用法及代碼示例
- JQuery UI Resizable ghost用法及代碼示例
- JQuery UI Resizable enable用法及代碼示例
- JQuery UI Resizable animateDuration用法及代碼示例
- JQuery UI Resizable start( event, ui )用法及代碼示例
- JQuery UI Resizable handles用法及代碼示例
- JQuery UI Resizable delay用法及代碼示例
- JQuery UI Resizable aspectRatio用法及代碼示例
- JQuery UI Resizable minWidth用法及代碼示例
- JQuery UI Resizable stop( event, ui )用法及代碼示例
- JQuery UI Resizable distance用法及代碼示例
注:本文由純淨天空篩選整理自jqueryui.com大神的英文原創作品 Resizable containment。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。