This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
107 lines (71 loc) · 1.98 KB
/
index.php
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
$layouts = array(
'masonry',
'fitRows',
'cellsByRow',
'straightDown',
'masonryHorizontal',
'fitColumns',
'cellsByColumn',
'straightAcross'
);
?><!DOCTYPE html>
<html>
<head>
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/jquery.isotope.min.js"></script>
<link type="text/css" rel="stylesheet" href="css/site.css"/>
<link href='http://fonts.googleapis.com/css?family=Open+Sans|Open+Sans+Condensed:300' rel='stylesheet'
type='text/css'>
<link type="text/css" rel="stylesheet" href="css/isotope.css"/>
<title>Isotope Hacking</title>
</head>
<body>
<div class='toolbar'>
<input type='text' id='width'/>
<button id='setWidth'>Set Width</button>
<select id='layout'>
<? foreach ($layouts as $layout): ?>
<option><?= $layout ?></option>
<? endforeach; ?>
</select>
<button id='setLayout'>Set</button>
</div>
<div id='container'>
<? for ($i = 0; $i < 10; $i++):
?>
<div class='item tileh<?= $i % 3 ?>'>
<div class='tile'>
<?= $i ?>
<br/>
<div class='title'>
<?= $i % 3 ?>
</div>
</div>
</div>
<? endfor; ?>
</div>
<script>
$(function () {
var $container = $('#container'),
$widthTextBox = $('#width');
$widthTextBox.val($container.width());
$container.isotope({
itemSelector: '.item',
layoutMode: 'masonry'
});
$('#setLayout').click(function () {
var mode = $('#layout').find(":selected").text();
$container.isotope('option', {
layoutMode: mode
});
$container.isotope('reLayout');
});
$('#setWidth').click(function () {
$container.width($widthTextBox.val());
$container.isotope('reLayout');
});
});
</script>
</body>
</html>