-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalignTest.html
60 lines (54 loc) · 3.27 KB
/
alignTest.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html ><head>
<title>Magic jQuery plugin example</title>
<link rel="canonical" href="http://www.jquery-css.com/magic-jquery"/>
<meta name="description" content="Magic jQuery plugin example" />
<meta name="keywords" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="X-UA-Compatible" content="chrome=1"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<link type="text/css" rel="stylesheet" rev="stylesheet" media="screen" href="http://www.jquery-css.com/_css/default.css" />
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<!--[if IE]>
<link href="http://www.jquery-css.com/_css/ie.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<!--[if IE 6]>
<link href="http://www.jquery-css.com/_css/ie6.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<style>
#orange, #blue, #yellow, #red, #pink {box-shadow:3px 3px 5px #111; -moz-box-shadow:3px 3px 5px #111;-webkit-box-shadow:3px 3px 5px #111}
@media (max-width: 600px) {
#blue {width:100px !important;height:40px !important;}
#red , #yellow{width:50px !important;height:50px !important;}
}
</style>
</head>
<body style="background:#292929;">
<h1 class="hidden">Magic jQuery example</h1>
<div id="blue" class="absolute height100" style="background:blue;width:240px"></div>
<div id="orange" class="absolute" style="width:100px; height:800px; background:orange;right:0;left:auto"></div>
<div id="red" class="" style="background:red; width:100px;height:100px;"></div>
<div id="yellow" class="gnogno" style="background:yellow; width:100px;height:100px;"></div>
<div id="pink" class="absolute coin" style="z-index:900000;width:100px;height:50px;background:pink; left:230px;top:140px">drag me</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript" src="magic.js" ></script>
<script type="text/javascript">
$(document).ready(function () {
$("#pink").draggable({ refreshPositions: true });
$("#pink").bind( "drag", function(event, ui) {if(!$("#pink").is(":visible"))console.log("invisible");$(window).resize();});
//You wouldn't even dreamed of such an easy Layout Manager :)
$("#blue").align({left:{my:0.5,at:1,selector:'#pink', offset:-20}, bottom:{at:1,selector:"#pink", offset:10}});
$("#blue").limit({top:{selector:window, offset:30}, left:{at:1,selector:"#orange", offset:30}, bottom:{at:1, selector:".gnogno", offset:30}, right:window});
$("#red").align({top:{at:1, selector:'#blue'}, left:{at:1, selector:"#blue"}});
$("#red").limit({right:window, bottom: window});
$("#yellow").align({top:{my:0.2,at:1, selector:'#red'}, left:{at:1, selector:"#red"}});
$("#yellow").limit({bottom: window, right:window});
$("#orange").align({top:window, bottom:window, left:window, right:{at:2.5, selector:'#pink'}});
$("#orange").limit({right:{at:1, selector:'#blue'}});
$(window).resize();
});
</script>
</body>
</html>