Ask questions and get good answers on jQuery

vote up 1 vote down
star
1

I've been having a lot of fun with this module trying to make a proof of concept mdi web page.

I was wanting to have the containerPlus containers appear inside a div section of my page only. I setup the containment option to the div and when dragging it works perfectly. When resizing a container the container can be made larger than the containment area. It seems the declaration for the resizable class in the containerPlus code doesn't actually set the containment option for resizable but the draggable declaration is setting it.

Am I missing something or is this working the was it is intended to be working?

flag

1 Answer

vote up 0 vote down

That seems a bug...

Add after line 96:

if (container.metadata().containment) container.attr("containment",container.metadata().containment);

Change at line 205 the "start" callback with:

  start:function(e,o){
    var el= container.attr("containment")?container.parents():$(window);
    var elPos= container.attr("containment")? container.position():container.offset();
    $(container).resizable('option', 'maxHeight',el.height()-(elPos.top-5));
    $(container).resizable('option', 'maxWidth',el.width()-(elPos.left-5));
    o.helper.mb_bringToFront();
  }

add as metadata of your container:

{containment:"parent", ...
link|flag

Your Answer

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.