jquery draggable enable and disable

后端 未结 5 2053
耶瑟儿~
耶瑟儿~ 2020-12-30 05:43

Ive tried anything to do this, but always get the same error

$(\".tooltip\").draggable(\'disable\');

Error: cannot call methods on draggabl

5条回答
  •  囚心锁ツ
    2020-12-30 06:18

    Try this:

    $(".tooltip").draggable({ disabled: true });
    

    This initializes the draggable in the disabled state. You can then use

    $(".tooltip").draggable("enable");
    

    later when you want to allow dragging.

提交回复
热议问题