forked from LinZap/jquery.waterfall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo-multi-water.html
50 lines (42 loc) · 1.51 KB
/
demo-multi-water.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Waterfall-Light Demo</title>
<style type="text/css">
*{margin: 0; padding:0;}
body{padding:20px;}
</style>
</head>
<body>
<h2>Box group 1</h2>
<div id="box-group-1"></div>
<h2>Box group 2</h2>
<div id="box-group-2"></div>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="waterfall-light.js"></script>
<script>
$(function(){
var boxGroup1 = $('#box-group-1');
for(var i=0;i<10;i++){
var card = $('<div>').addClass('card').css({
height: Math.floor((Math.random() * 100) + 100)+"px",
background: '#ace'
}); boxGroup1.append(card);
}
var boxGroup2 = $('#box-group-2');
for(var i=0;i<10;i++){
var card = $('<div>').addClass('card').css({
height: Math.floor((Math.random() * 100) + 100)+"px",
background: '#F85C5C'
}); boxGroup2.append(card);
}
// useage: fallow below
$('#box-group-1').waterfall();
$('#box-group-2').waterfall();
//eoiwefoiwef
});
</script>
</body>
</html>