forked from kombai/freewall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfit-height.html
89 lines (86 loc) · 2.42 KB
/
fit-height.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html>
<head>
<title>Freewall dem Fit height</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta name="description" content="Freewall dem Fit height" />
<meta name="keywords" content="javascript, dynamic, grid, layout, jquery plugin, fit height"/>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="../freewall.js"></script>
<style type="text/css">
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
.layout {
position: absolute;
right: 0px;
left: 0px;
top: 124px;
bottom: 0px;
padding: 15px;
overflow-x: auto;
overflow-y: hidden;
}
.free-wall {
height: 100%;
}
</style>
</head>
<body>
<div class='header'>
<div class="clearfix">
<div class="float-left">
<h1><a href="http://vnjs.net/www/project/freewall/">Free Wall</a></h1>
<div class='target'>Creating dynamic grid layouts.</div>
</div>
</div>
</div>
<div class="layout">
<div id="freewall" class="free-wall">
<div class="brick size22"></div>
<div class="brick size12"></div>
<div class="brick size22"></div>
<div class="brick size22"></div>
<div class="brick size11"></div>
<div class="brick size23"></div>
<div class="brick size22"></div>
<div class="brick size22"></div>
<div class="brick size21"></div>
<div class="brick size12"></div>
<div class="brick size32"></div>
<div class="brick size32"></div>
<div class="brick size31"></div>
<div class="brick size21"></div>
<div class="brick size32"></div>
<div class="brick size11"></div>
<div class="brick size21"></div>
<div class="brick size23"></div>
<div class="brick size21"></div>
<div class="brick size21"></div>
</div>
</div>
<script type="text/javascript">
$(".free-wall .brick").each(function(index, item) {
item.style.backgroundImage = "url(i/photo/" + (++index) + ".jpg)";
});
$(function() {
var wall = new freewall("#freewall");
wall.reset({
selector: '.brick',
cellW: 160,
cellH: 160,
onResize: function() {
wall.fitHeight($(window).height() - 170);
}
});
// caculator height for IE7;
wall.fitHeight($(window).height() - 170);
$(window).trigger("resize");
});
</script>
</body>
</html>