jQuery UI draggable() and resizable()

Posted by foxlance on Stack Overflow See other posts from Stack Overflow or by foxlance
Published on 2010-04-13T03:48:42Z Indexed on 2010/04/13 3:52 UTC
Read the original article Hit count: 354

Filed under:
|

I want to write the draggable() and resizable() code in such a way that all future elements with a particular class will inherit those plugins without calling them again.

$('div.resizeMe').resizable({
containment: 'parent',
minWidth: 400,
minHeight: 200
})

When the above code is executed, all divs with resizeMe class inherits the resizable() function. But if I appended BODY with a new div with the same class, I needed to execute that code again. So my goal here is how to rewrite that code such that it will work for all and including future elements.

© Stack Overflow or respective owner

Related posts about jquery-ui

Related posts about jQuery