Bug Tracker

Ticket #2171 (new enhancement)

Opened 11 months ago

Last modified 10 months ago

allow containing draggable elements within the window

Reported by: scott.gonzalez Assigned to: paul
Type: enhancement Priority: minor
Milestone: 1.2.3 Component: ui
Version: 1.2.2 Keywords: draggable containment window
Cc: Needs: Review

Description

Add support for containing draggable elements within the window.

$('#drag').draggable({
    containment: window
});

I've added a patch, but the behavior is a little strange in Opera because if you move your mouse out of the window while dragging, the page will scroll. The containment behaves as expected in other tested browsers (IE 6, Firefox 2, Safari 3 for Windows).

Attachments

containmentwindow.patch (0.8 kB) - added by scott.gonzalez 11 months ago.
containment-window-fixed.patch (2.5 kB) - added by scott.gonzalez 10 months ago.
with fixed position support

Change History

Changed 11 months ago by scott.gonzalez

Changed 10 months ago by scott.gonzalez

with fixed position support

Changed 10 months ago by scott.gonzalez

I just added a new patch which includes fixed position support (requires patch from #2161).

Changed 10 months ago by scott.gonzalez

In IE, the containment is off by the size of the scrollbar for elements that have fixed or absolute positioning.

Note: See TracTickets for help on using tickets.