How do I disable a jquery-ui draggable?

后端 未结 9 1459
萌比男神i
萌比男神i 2020-11-29 04:46

How do I disable a jQuery draggable, e.g. during an UpdatePanel postback?

9条回答
  •  暖寄归人
    2020-11-29 05:31

    The following is what this would look like inside of .draggable({});

    $("#yourDraggable").draggable({
        revert: "invalid" ,
        start: function(){ 
            $(this).css("opacity",0.3);
        },
        stop: function(){ 
            $(this).draggable( 'disable' )
        },
        opacity: 0.7,
        helper: function () { 
            $copy = $(this).clone(); 
            $copy.css({
                "list-style":"none",
                "width":$(this).outerWidth()
            }); 
            return $copy; 
        },
        appendTo: 'body',
        scroll: false
    });
    

提交回复
热议问题