2012-01-11 38 views
0

サイズ変更可能なjQuery UIを読みました。その後、私はコードを使用し、成功を収めた。しかし、今私はラインの "オプション"を理解していないjQuery UIのサイズ変更のオプション

$(".selector").resizable({ handles: 'n, e, s, w' }); 

Get or set the handles option, after init. 

    //getter 
    var handles = $(".selector").resizable("option", "handles"); 
    //setter 
    $(".selector").resizable("option", "handles", 'n, e, s, w'); 

どのようなオプションです。最後に最後の行$(".selector").resizable("option", "handles", 'n, e, s, w');

+0

大変申し訳ありませんが、あなたが話していることの手掛かりはありません。あなたは具体的な質問をしてくださいできますか? – Connum

答えて

2

option is a method。 jQueryのUIメソッドは、ウィジェット関数(この場合はresizable)をメソッド名を表す文字列を第1引数として呼び出して実行する傾向があります。

2番目の引数は取得/設定したいオプションの名前で、3番目の引数(存在する場合)はオプションを設定する値です。あなたがウィジェットを有効または無効にでき同様に

、:

$(".selector").resizable("enable"); //Call the enable method 
$(".selector").resizable("disable"); //Call the disable method 
$(".selector").resizable("option", "handles"); //Call the option method, get the handles option value 

たとえば、あなたがresizableが有効かされていない、あなたができるかどうかを知りたいと思った場合:

//If it's disabled, disabled == true. If not, disabled == false 
var disabled = $(".selector").resizable("option", "disabled"); 

//After the following line, the resizable element will be in the opposite state 
//(if it was enabled, it will be disabled, and vice versa) 
$(".selector").resizable("option", "disabled", !disabled); 
+0

あなたはその例を挙げることができます – Jackson

+0

何の例ですか?何を私に見せたいのですか? –

+0

私はオプションの方法の例を意味します – Jackson

関連する問題