-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaso.php
More file actions
59 lines (47 loc) · 1.25 KB
/
maso.php
File metadata and controls
59 lines (47 loc) · 1.25 KB
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
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<style type="text/css">
.item {
float: left;
width: 150px;
margin: 0px 3px 3px 3px;
position: relative;
}
.item img { max-width: 100%; height: auto; margin: 0;}
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: none;}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script src="js/masonry.js"></script>
<script>
$(document).ready(function() {
var $container = $('#container');
$container.imagesLoaded( function(){
$container.masonry({
itemSelector : '.item',
isAnimated: true
});
});
$('.item').hover(function() {
$(this).find('.overlay').fadeIn(150);
}, function() {
$(this).find('.overlay').fadeOut(150);
})
});
</script>
</head>
<body style="padding: 50px; font-size: 14px; font-family: Helvetica, Arial, sans-serif; color: #555;background: #eee;">
<div id="container">
<?php
for($x=0; $x<20; $x++) {
$w = mt_rand(150, 450);
$h = mt_rand(150, 450);
echo '<div class="item">';
echo '<div class="overlay"></div>';
echo '<img src="http://placekitten.com/' . $w . '/' . $h . '"></div>';
}
?>
</div>
</body>
</html>