-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathpercent-horizontal.html
73 lines (66 loc) · 2.4 KB
/
percent-horizontal.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>Percent horizontal</title>
<link rel="stylesheet" href="../split-pane.css" />
<!-- The style sheet below is not part of the split-pane plugin. Feel free to use it, or style things your own way. -->
<link rel="stylesheet" href="../pretty-split-pane.css" />
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
<script src="../split-pane.js"></script>
<style type="text/css">
html, body {
height: 100%;
min-height: 100%;
margin: 0;
padding: 0;
}
#top-component {
bottom: 70%;
margin-bottom: 5px;
min-height: 5em;
}
#my-divider {
bottom: 70%;
height: 5px;
}
#bottom-component {
height: 70%;
min-height: 10em;
}
</style>
<script>
$(function() {
$('div.split-pane').splitPane();
$('button:first').on('click', function() {
$('div.split-pane').splitPane('lastComponentSize', 200);
});
$('button:last').on('click', function() {
$('div.split-pane').splitPane('firstComponentSize', 0);
});
});
</script>
</head>
<body>
<div class="pretty-split-pane-frame"><!-- This div is added for styling purposes only. It's not part of the split-pane plugin. -->
<div class="split-pane horizontal-percent">
<div class="split-pane-component" id="top-component">
<div class="pretty-split-pane-component-inner"><!-- This div is added for styling purposes only. It's not part of the split-pane plugin. -->
<p>This split pane component height is in percent. <code>min-height</code> (<code>5em</code> in this exampe) will be respected</p>
<p>Re-size the window and move the divider to see the effect!</p>
<p><button>Set last component size to 200px</button></p>
</div>
</div>
<div class="split-pane-divider" id="my-divider"></div>
<div class="split-pane-component" id="bottom-component">
<div class="pretty-split-pane-component-inner"><!-- This div is added for styling purposes only. It's not part of the split-pane plugin. -->
<p>This split pane component height is in percent. <code>min-height</code> (<code>10em</code> in this exampe) will be respected</p>
<p><button>Collapse first component</button></p>
</div>
</div>
</div>
</div>
</body>
</html>