1

我需要设置一个特定区域以允许拖动。目前,我将其设置如下:

dragthis.draggable({
    drag: function(event, ui) {
        if (ui.position.left < 0) {
            return false;
        } else {
            return true;
        }
    }
});

IE8的return false;工作正常,但之后拖动不起作用。我究竟做错了什么?

4

1 回答 1

2

您是否尝试过使用遏制选项来限制移动?

http://jqueryui.com/draggable/#constrain-movement

http://api.jqueryui.com/draggable/#option-containment

于 2013-05-23T17:00:29.550 回答