2011-08-08 14 views
0

この質問に対する回答を得ようとしています。 javascriptでdraggableオプションを無効にするにはどうすればよいですか? APIドキュメントは、javascriptでドラッグ可能なオプションを設定する

.draggable({disable:true})と言っています。

または

.draggable( "オプション"、 "無効"、真の);

私にとってもそれはありません。ここに私が持っている図書館があります。

<link rel="stylesheet" href="http://jqueryui.com/themes/base/jquery.ui.all.css"> 
<script src="http://jqueryui.com/jquery-1.5.1.js"></script> 
<script src="http://jqueryui.com/ui/jquery.ui.core.js"></script> 
<script src="http://jqueryui.com/ui/jquery.ui.widget.js"></script> 
<script src="http://jqueryui.com/ui/jquery.ui.mouse.js"></script> 
<script src="http://jqueryui.com/ui/jquery.ui.resizable.js"></script> 
<script src="http://jqueryui.com/ui/jquery.ui.draggable.js"></script> 

私はこのようなコードでドラッグ可能オプションを無効にしようとしています。

editable.parent().draggable({disable: true}); 
editable.parent().draggable("option", "disable", true); 

editable.parent()は正しい要素を見つけますが、ドラッグ可能なオプションはオフになっていません。

ありがとうございました。

答えて

0

試してみてください。

editable.parent().draggable({disabled: true}); 

または:

どちらかが動作するはず
editable.parent().draggable("option", "disabled", true); 

。あなたはdisabled

0

1)の終わりに 'd' はセレクタがOKであることを確認し忘れた

2)

.draggable("disable") 
関連する問題