1

Can I pass my own object pretending to be a selector as a containment to resizable?

Please note, I've read all questions about dynamic containment/refresh containment the solutions aren't good enough for me.

the idea is - JQuery UI will evaluate containment object's size & position hopefully by calling containment.width(), containment .height() and containment.position(), so by providing my own implementations I can get my containment dynamic.

Here's some code, which doesn't work:

var fake = { width: fucnction(){ return 100; }, height: function(){ return 200; }, position: function(){ return { left:100, top:100 }}}};

element.resizable({containment: fake});

Wonder if it's doable that way and what am I missing?

4

0 回答 0