Search code examples
javascriptjqueryw2ui

How to specify w2ui panel size in em instead of px?


w2ui layout examples use pixels for panel size: http://w2ui.com/web/demos/#!layout/layout-1

However, I want to specify panel size in em. Is it possible?


Solution

  • Short answer:

    No. Only px (default if no unit is specified) and % are supported.

    Long answer:

    While it is possible to force a specific height/width for individual panels by using the panel's style property (e.g. style: "height: 15em !important;"), I would not suggest to use it, because the height/width of other panels is still calculated by the original size property.

    If you want to do it that way, be prepared that you will have to specify all height/width values yourself for all panels and resizing will not work - at which point there's probably no longer a benefit of using the w2layout over designing something with flex boxes yourself.