initial commit
[JIRC.git] / public / windows_js_1.3 / samples / constraint.html
CommitLineData
39c8b14f 1<html>
2 <head>
3
4 <link href="../themes/default.css" rel="stylesheet" type="text/css"/>
5 <link href="../themes/alphacube.css" rel="stylesheet" type="text/css"/>
6
7 <script type="text/javascript" src="../javascripts/prototype.js"> </script>
8 <script type="text/javascript" src="../javascripts/effects.js"> </script>
9 <script type="text/javascript" src="../javascripts/window.js"> </script>
10 <script type="text/javascript" src="../javascripts/window_effects.js"> </script>
11 <script type="text/javascript" src="../javascripts/debug.js"> </script>
12
13<script type="text/javascript">
14function win1()
15{
16 var win = new Window({id: "win1", className: "alphacube", title: "Sample", width:250, height:150, top:0, left: 1, parent:$('container')});
17 win.getContent().innerHTML = "<h1>Constraint inside a div !!</h1>constraint: {left:10, right:20}<br><a href='#' onclick='Windows.getWindow(\"win1\").maximize()'>Maximize me</a>";
18
19 win.setDestroyOnClose();
20 win.show();
21 win.setConstraint(true, {left:10, right:20})
22 win.toFront();
23}
24
25function win2()
26{
27 var win = new Window({id: "win2", className: "alphacube", title: "Sample", width:200, height:150});
28 win.getContent().innerHTML = "<h1>Constraint inside page !!</h1>constraint: {top: 30, bottom:10}<br><a href='#' onclick='Windows.getWindow(\"win2\").maximize()'>Maximize me</a>";
29
30 win.setDestroyOnClose();
31 win.showCenter();
32 win.setConstraint(true, {left:0, right:0, top: 30, bottom:10})
33 win.toFront();
34}
35
36function win3()
37{
38 var win = new Window({id: "win3", className: "alphacube", title: "Sample", width:250, height:150, wiredDrag: true});
39 win.getContent().innerHTML = "<h1>No Constraint</h1>Wired mode<br><a href='#' onclick='Windows.getWindow(\"win3\").maximize()'>Maximize me</a>";
40 win.setDestroyOnClose();
41 win.setLocation(10, 500);
42 win.show();
43 win.toFront();
44}
45
46</script>
47<style>
48body {
49 background: #363636;
50}
51#border {
52 position:absolute;
53 top:10px;
54 left:10px;
55 width:500px;
56 height:500px;
57 border: 1px solid #000;
58 overflow:hidden;
59}
60#container {
61 position:absolute;
62 top:0px;
63 left:0px;
64 width:500px;
65 height:500px;
66 overflow:hidden;
67 background:#DAEE9B;
68 z-index:0;
69}
70</style>
71</head>
72<body>
73
74<div id="border">
75 <div id="container"></div>
76</div>
77
78<script>
79 win1();
80 win2();
81 win3();
82</script>
83</body></html>