I'm trying out a relatively new JavaScript/jQuery UI library, w2ui. I've got a layout working in my LAMP application, but I am wondering how to make the layout div take the full height of the screen. Here's a demo of a resizable layout from the official site.
Here is the HTML div which will become my layout container:
<div
id="layout"
style="width: 100%; height: 600px; margin-bottom: 10px;"
></div>
That works with '600px' as a height, but not '100%', which makes it invisible.
And the JavaScript (a few bits removed just for brevity):
var pstyle = 'border: 1px solid #dfdfdf; padding: 5px;';
$('#layout').w2layout({
name: 'layout',
panels: [
{ type: 'top', size: 50, resizable: true, style: pstyle, content: 'top' },
{
type: 'left', size: 800, resizable: true, style: pstyle, content: 'tab1'
},
{ type: 'main', style: pstyle, content: 'main' },
{ type: 'right', size: 200, resizable: true, style: pstyle, content: 'right' }
]
});
The layout docs don't mention setting a % height, though it's early days! Perhaps this question will act as a prompt.
One solution would be to read the Y dimension of the top of the layout, and then subtract this from the screen height, and then create the layout of that height. That would probably work, but if the screen resized I'd have to recalculate and reset the height, which is a bit hacky.