Bug Tracker

Modify

Ticket #2171 (closed enhancement: invalid)

Opened 5 years ago

Last modified 3 years ago

allow containing draggable elements within the window

Reported by: scott.gonzalez Owned by: paul
Priority: minor Milestone: 1.2.3
Component: ui Version: 1.2.2
Keywords: draggable containment window Cc:
Blocking: Blocked by:

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 Download (816 bytes) - added by scott.gonzalez 5 years ago.
containment-window-fixed.patch Download (2.5 KB) - added by scott.gonzalez 5 years ago.
with fixed position support

Change History

Changed 5 years ago by scott.gonzalez

Changed 5 years ago by scott.gonzalez

with fixed position support

comment:1 Changed 5 years ago by scott.gonzal

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

comment:2 Changed 5 years ago by scott.gonzal

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

comment:3 Changed 3 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to invalid

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.