Bug Tracker

Modify

Ticket #1969 (closed feature: invalid)

Opened 6 years ago

Last modified 15 months ago

UI.draggable - limits/boundaries

Reported by: pwoldberg Owned by:
Priority: minor Milestone: 1.2.2
Component: ui Version: 1.2.1
Keywords: Cc:
Blocking: Blocked by:

Description

Would be nice to have limits/boundaries for draggable elements. Currently it can be limited by a parent element and by x- or y-axis.

Example for implementation:

jQuery('#drag').draggable({
  limit: {top: 50, left: 100, bottom: 200, right: 200}
});

jQuery('#dragHorizontal').draggable({
  axis : 'x',
  limit: {left: 100, right: 400}
});

I don't know if top, left, bottom and right would be best to set the boundaries, an other idea is to use x1, y1, x2 and y2.

Change History

comment:1 Changed 5 years ago by m0n5t3r

this could also e useful in another problem: when you drag something towards the right/bottom border of the screen, the page will be expanded horizontally/vertically, which is leads to ugly results; so, constraining by default to the window limits would be nice.

comment:2 Changed 5 years ago by paul

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

this can be done using the containment option.

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.