문제

I'm trying to use a button to turn on and off the .selectable behaviour for a div on my page. I can do this using these commands:

$('#selectable').selectable({disabled: true})

or

$('#selectable').selectable("option", "disabled", true)

The functionality works as intended, but the only problem is that it grays out the entire element that was selectable. Enabling selectability removes the grayed-out look, but every time i disable the selectable it grays out.

Does anyone know how to disable selectability as an attribute without graying out the whole element?

도움이 되었습니까?

해결책

How about just destroying the selectable $( "#selectable" ).selectable( "destroy" ); and when you need it back $( "#selectable" ).selectable();

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top