Ask questions and get good answers on mb.jQuery.components

Hello, I would like to ask about docking in containerplus. It's very nice plugin and want to use it but my goal is create 5 windows with containerplus and 2 from them as docked like in "docked demo" rest 3 windows can minimalize etc. but dont want to dock them. unfortunatly when I use code from "docked demo" all windows in default are docked. How can I prevent to dock 3 windows?

Thx in any advance

asked Sep 30 '10 at 04:57

stefek143's gravatar image

stefek143
111


Hi, If you need to show containers on page load and mantain the dock behavior just remove the iconized:'true' and the "i" buton property from the DIV:

... class="containerPlus draggable resizable {buttons:'m,c', icon:'chart.png', skin:'default', width:'500', dock:'dock', title:'container 3'}" ...

If you don't want some containers to be dockable than you need to initialize those without the callbak functions. In that case the example is not exaustive. You need to add a specific class for the one you whant to dock and one for the others and then initialize them separately:

For example add a "dockable" class for the dockable containers and "undockable" for the others:

  <div id="c1" 
   class="containerPlus dockable draggable resizable {buttons:'m,i,c', icon:'browser.png', skin:'black', width:'500',iconized:'true', dock:'dock', title:'container 1'}"  
   style="position:fixed;top:130px;left:400px">[content goes here]</div>

 <div id="c2" 
  class="containerPlus undockable draggable resizable {buttons:'m,c', icon:'browser.png', skin:'black', width:'500', title:'container 2'}"
  style="position:fixed;top:130px;left:400px">[content goes here]</div>

Then initialize as follow:

  $(".dockable").buildContainers({
    containment:"document",
    elementsPath:"../elements/",
    dockedIconDim:45,
    onCreate:function(o){initDock(o,"dock")},
    onClose:function(o){close(o)},
    onRestore:function(o){restore(o)},
    onIconize:function(o){iconize(o)},
    effectDuration:300
  });

  $(".undockable").buildContainers({
    containment:"document",
    elementsPath:"../elements/",
    dockedIconDim:45,
    effectDuration:300
  });

That's all. Bye, Matteo

answered Sep 30 '10 at 13:25

Matteo%20Bicocchi's gravatar image

Matteo Bicocchi ♦♦
1776129

edited Sep 30 '10 at 13:49

Your answer
toggle preview

jQuery main site - Matteo Bicocchi