2011-04-24 11:46:45 +12:00

96 lines
2.5 KiB
HTML
Executable File

<!DOCTYPE html>
<html>
<head>
<title>Toggle-able Border Layout example</title>
<meta http-equiv="Content-Type" content="text/html; 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 relayout() {
container.layout({resize: false});
}
relayout();
$(window).resize(relayout);
$('#toggle-west').click(function () {
$('.west').animate({width: 'toggle'}, {duration: 500, complete: relayout, step: relayout});
});
$('#toggle-east').click(function () {
$('.east').animate({width: 'toggle'}, {duration: 500, complete: relayout, step: relayout});
});
$('#toggle-north').click(function () {
$('.north').animate({height: 'toggle'}, {duration: 500, complete: relayout, step: relayout});
});
$('#toggle-south').click(function () {
$('.south').animate({height: 'toggle'}, {duration: 500, complete: relayout, step: relayout});
});
});
</script>
<style>
html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
.layout {
height: 100%;
}
.center, .east, .west, .north, .south {
background-color: rgb(220,220,220);
border: 1px solid rgb(200,200,200);
text-align: center;
display: inline-block;
}
.west, .east {
width: 8%;
}
.north, .south {
height: 10%;
}
</style>
</head>
<body>
<div class="layout {layout: {type: 'border', hgap: 3, vgap: 3}}">
<div class="center">
Center
<h1><a href="http://www.bramstein.com/projects/jlayout/">jLayout project homepage</a></h1>
<button id="toggle-north">Toggle North</button>
<button id="toggle-west">Toggle West</button>
<button id="toggle-south">Toggle South</button>
<button id="toggle-east">Toggle East</button>
</div>
<div class="east">
East
</div>
<div class="west">
West
</div>
<div class="north">
North
</div>
<div class="south">
South
</div>
</div>
</body>
</html>