JavaScript Tutorial/Dojo toolkit/SplitPane
Версия от 18:52, 25 мая 2010; (обсуждение)
Use splitpane
<html>
<head>
<link rel="StyleSheet" type="text/css"
href="js/dojo/dijit/themes/tundra/tundra.css">
<script type="text/javascript">
var djConfig = {
baseScriptUri : "js/dojo/",
parseOnLoad : true
};
</script>
<script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
<script>
dojo.require("dojo.parser");
dojo.require("dijit.layout.SplitContainer");
dojo.require("dijit.layout.ContentPane");
</script>
</head>
<body class="tundra">
<div dojoType="dijit.layout.SplitContainer"
orientation="horizontal"
sizerWidth="10" activeSizing="true"
style="border: 1px solid #FF00FF; width: 600px; height: 205px;">
<div dojoType="dijit.layout.ContentPane" sizeMin="10" sizeShare="10">
<paragraph><b>Title</b></paragraph>Content
</div>
<div dojoType="dijit.layout.ContentPane" sizeMin="10" sizeShare="10">
<paragraph><b>SubTitle</b></paragraph>
Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>
</div>
</div>
</body>
</html>
Use splitter content pane
<html>
<head>
<link rel="StyleSheet" type="text/css" href="js/dojo/dijit/themes/tundra/tundra.css">
<script type="text/javascript">
var djConfig = {
baseScriptUri : "js/dojo/",
parseOnLoad : true
};
</script>
<script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
<script>
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.BorderContainer");
dojo.require("dojo.parser");
</script>
</head>
<body class="tundra">
<div dojoType="dijit.layout.BorderContainer" design="headline"
style="height:500px;width:500px;border:solid 3px;">
<div dojoType="dijit.layout.ContentPane" region="top"
style="background-color:#f21;height:100px;" splitter="true"
minSize=10 maxSize=100>top</div>
<div dojoType="dijit.layout.ContentPane" region="center">center</div>
<div dojoType="dijit.layout.ContentPane" region="bottom"
style="height:100px;" splitter="true">bottom</div>
</div>
</body>
</html>