-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.php
executable file
·117 lines (92 loc) · 3.79 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
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jSquares - An image collage like the ted.com homepage</title>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">google.load("jquery","1.6.1");</script>
<!-- styles -->
<link rel="stylesheet" href="css/jsquares.css" type="text/css" media="all" />
<!-- js -->
<script src="js/jquery.hoverintent.min.js" type="text/javascript"></script>
<script src="js/jquery.jsquares.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#js-container').jsquares();
$('#js-container-2').jsquares({
shuffle_in: false, // have the pictures all fade in on page load?
fade_on_hover: false, // do we want the images to fade on hover or just change opacity?
caption_slide_down: false // do we want the caption to slide down or just appear?
});
});
</script>
</head>
<body>
<?
// Just a template for drawing the boxes, feel free to mofidy to fit your needs
$boxes = array(
// sizes are styled through css and top, left css attributes are hard-coded on the div
array('size' => 3, 'top' => 0, 'left' => 0),
array('size' => 2, 'top' => 0,'left' => 224),
array('size' => 2, 'top' => 78, 'left' => 224),
array('size' => 3, 'top' => 0, 'left' => 336),
array('size' => 2, 'top' => 0, 'left' => 560),
array('size' => 2, 'top' => 78, 'left' => 560),
array('size' => 2, 'top' => 156, 'left' => 0),
array('size' => 3, 'top' => 156, 'left' => 112),
array('size' => 2, 'top' => 156, 'left' => 336),
array('size' => 1, 'top' => 156, 'left' => 448),
array('size' => 1, 'top' => 195, 'left' => 448),
array('size' => 2, 'top' => 156, 'left' => 504),
array('size' => 1, 'top' => 156, 'left' => 616),
array('size' => 1, 'top' => 234, 'left' => 56),
array('size' => 1, 'top' => 234, 'left' => 336)
);
?>
<h2>Example 1 (default)</h2>
<pre>$('#js-container').jsquares();</pre>
<div id="js-container">
<?
foreach($boxes as $box){
?>
<div class="js-image size-<?= $box['size']; ?>" style="top:<?= $box['top']; ?>px;left:<?= $box['left']; ?>px;">
<a href="#wolf!"><img class="js-small-image" src="images/wolf-moon.jpg"/></a>
<div class="js-small-caption">
<span>Howlla at cha boy!</span>
</div>
<div class="js-overlay-caption-content">
<h4>You can't hide from wolf boy.</h4>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In elementum arcu non orci fermentum nec suscipit neque dignissim... <a href="#">Read more »</a>
</p>
</div>
</div>
<? } ?>
</div>
<h2>Example 2</h2>
<pre>
$('#js-container-2').jsquares({
shuffle_in: false, // have the pictures all fade in on page load?
fade_on_hover: false, // do we want the images to fade on hover or just change opacity?
caption_slide_down: false // do we want the caption to slide down or just appear?
});</pre>
<div id="js-container-2">
<?
foreach($boxes as $box){
?>
<div class="js-image size-<?= $box['size']; ?>" style="top:<?= $box['top']; ?>px;left:<?= $box['left']; ?>px;">
<img class="js-small-image" src="images/sesame-street.jpg"/>
<div class="js-small-caption">
<span>Everyone loves this show</span>
</div>
<div class="js-overlay-caption-content">
<h4>Sesame Street!</h4>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In elementum arcu non orci fermentum nec suscipit neque dignissim... <a href="#">Read more »</a>
</p>
</div>
</div>
<? } ?>
</div>
</body>
</html>