user1480192
user1480192

Reputation: 863

jquery ui resizable - prevent overlap

I have multiple divs with absolute positioning on a page, all with the same class. Is there a way to restrict resizing each of the divs so that they do not overlap any of the other divs of the same class?

Upvotes: 1

Views: 613

Answers (1)

Wouter Bouwman
Wouter Bouwman

Reputation: 1013

You can use the resize event from jQuery-ui resizable. Calculate if your element is about to pass another elements top/left positions and prevent it from doing so by setting the maxWidth to it's current width.

Source: Prevent jQuery UI resizable element from covering another element?

Upvotes: 1

Related Questions