mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
133 lines
3.5 KiB
HTML
Executable File
133 lines
3.5 KiB
HTML
Executable File
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>Resizing Border Layout example</title>
|
|
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8" />
|
|
<link type="text/css" href="../../lib/jquery-ui-1.7.1.custom.css" rel="stylesheet" />
|
|
<script type="text/javascript" src="../../lib/jquery-1.4.2.js"></script>
|
|
<script type="text/javascript" src="../../lib/jquery-ui-1.7.1.custom.min.js"></script>
|
|
<script type="text/javascript" src="../../lib/jquery.metadata.js"></script>
|
|
<script type="text/javascript" src="../jsizes/jquery.sizes.js"></script>
|
|
<script type="text/javascript" src="jlayout.border.js"></script>
|
|
<script type="text/javascript" src="jquery.jlayout.js"></script>
|
|
<script type="text/javascript">
|
|
jQuery(function($)
|
|
{
|
|
var container = $('.layout');
|
|
|
|
function layout() {
|
|
container.layout({resize: false, type: 'border', vgap: 8, hgap: 8});
|
|
}
|
|
|
|
$('.north').resizable({
|
|
handles: 's',
|
|
stop: layout,
|
|
resize: layout
|
|
});
|
|
|
|
$('.south').resizable({
|
|
handles: 'n',
|
|
stop: layout,
|
|
resize: layout
|
|
});
|
|
|
|
$('.east').resizable({
|
|
handles: 'w',
|
|
stop: layout,
|
|
resize: layout
|
|
});
|
|
|
|
$('.west').resizable({
|
|
handles: 'e',
|
|
stop: layout,
|
|
resize: layout
|
|
});
|
|
|
|
$(window).resize(layout);
|
|
|
|
layout();
|
|
layout();
|
|
});
|
|
</script>
|
|
<style>
|
|
html, body {
|
|
width: 100%;
|
|
height: 100%;
|
|
padding: 0;
|
|
margin: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.layout {
|
|
height: 100%;
|
|
background-color: rgb(220, 220, 220);
|
|
}
|
|
|
|
.center, .east, .west, .north, .south {
|
|
background-color: white;
|
|
border: 1px solid rgb(200, 200, 200);
|
|
text-align: center;
|
|
display: inline-block;
|
|
padding: 1em;
|
|
}
|
|
|
|
p {
|
|
text-align: left;
|
|
}
|
|
|
|
.west, .east {
|
|
width: 8%;
|
|
}
|
|
|
|
.north, .south {
|
|
height: 10%;
|
|
}
|
|
|
|
/**
|
|
* These styles are to create custom resize handles.
|
|
*/
|
|
.ui-resizable-w {
|
|
left: -8px;
|
|
width: 8px;
|
|
}
|
|
|
|
.ui-resizable-e {
|
|
right: -8px;
|
|
width: 8px;
|
|
}
|
|
|
|
.ui-resizable-n {
|
|
top: -8px;
|
|
height: 8px;
|
|
}
|
|
|
|
.ui-resizable-s {
|
|
bottom: -8px;
|
|
height: 8px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="layout">
|
|
<div class="center">
|
|
Center
|
|
<h1><a href="http://www.bramstein.com/projects/jlayout/">jLayout project homepage</a></h1>
|
|
<p>This example uses the <code>resize</code> callback on the jQuery UI resizable "widget" to resize the layout while dragging the borders. Combined with some custom CSS rules, this makes for a very elegant resizable border layout. Please take care while using the <code>resize</code> event handler as recalculating the layout every pixel is expensive and older browsers might not have smooth resizing as a result.</p>
|
|
</div>
|
|
<div class="east">
|
|
East
|
|
</div>
|
|
<div class="west">
|
|
West
|
|
</div>
|
|
<div class="north">
|
|
North
|
|
</div>
|
|
<div class="south">
|
|
South
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|