forked from tasuki/masonry-ordered
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
115 lines (105 loc) · 2.29 KB
/
index.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
title: jQuery Masonry Ordered
layout: default
category: home
mini_bricks:
- w: 9
h: 4
- w: 4
h: 6
- w: 4
h: 4
- w: 6
h: 4
- w: 4
h: 4
- w: 7
h: 4
- w: 4
h: 4
- w: 4
h: 6
- w: 4
h: 5
- w: 4
h: 4
- w: 4
h: 7
- w: 9
h: 4
- w: 4
h: 4
---
<div class="item col2">
Alternative layout strategy for <a href="http://masonry.desandro.com">jQuery Masonry</a><br/>
Keeps the items in original order<br/>
<br/>
← View docs and demos
</div>
<div class="item">
Before: Masonry
<div id="masonry" class="mason">
{% for brick in page.mini_bricks %}
<div style="width: {{ brick.w }}0px; height: {{ brick.h }}0px; line-height: {{ brick.h }}0px;">
{{ forloop.index }}
</div>
{% endfor %}
</div>
</div>
<div class="item">
After: Ordered
<div id="masonry-ordered" class="mason">
{% for brick in page.mini_bricks %}
<div style="width: {{ brick.w }}0px; height: {{ brick.h }}0px; line-height: {{ brick.h }}0px;">
{{ forloop.index }}
</div>
{% endfor %}
</div>
</div>
<div class="item small-text">
<h3>What?</h3>
David DeSandro's jQuery Masonry loops through the items
and places each as close to the top as possible.
<br/><br/>
JQuery Masonry Ordered tries to preserve the previous/next relationship
of the elements in the sequence.
</div>
<div class="item link"><a href="{{ root_path }}jquery.masonry.ordered.js">
<strong>Download</strong> the jquery.​masonry.​ordered.js script
</a></div>
<div class="item link"><a href="http://github.com/tasuk/masonry-ordered">
jQuery Masonry Ordered on <strong>GitHub</strong>:<br/>
– browse the code<br/>
– submit bug reports<br/>
– fork & contribute
</a></div>
<div class="item small-text">
<h3>Is there a tradeoff?</h3>
Yes, Masonry Ordered usually takes up visibly more vertical space.
</div>
<script>
$(document).ready(function(){
$('#masonry').masonry({
itemSelector: 'div',
columnWidth: 10,
layoutPriorities: {
shelfOrder: 0
}
});
$('#masonry-ordered').masonry({
itemSelector: 'div',
columnWidth: 10,
layoutPriorities: {
shelfOrder: 2
}
});
$('#content').masonry({
itemSelector: '.item',
isAnimated: true,
columnWidth: 240,
layoutPriorities: {
shelfOrder: 0
}
});
});
</script>