-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.html
49 lines (44 loc) · 1.37 KB
/
template.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
<html>
<head>
<!-- include knockout, jquery, and imageGrid.js here -->
<style>
#container >ul >li{
position: relative;
float: left;
padding: 0px;
margin: 3px;
}
#container >ul >li >div{
overflow: hidden;
}
#container .full_width {
margin: 0;
text-align: center;
background: #333;
padding: 20px 0;
}
</style>
</head>
<body>
<div id="container" data-bind="template: 'image_grid' "></div>
<script id="image_grid" type="text/html">
<ul class="image_grid clearfix" data-bind="foreach: images, style: { minHeight: winMinHeight }">
<li data-bind="template: 'image_block' "></li>
<!-- ko if: rowEnd() -->
<li data-bind="template: 'image_full_row'"></li>
<!-- /ko -->
</ul>
</script>
<script id="image_block" type="text/html">
<div data-bind="visible: vwidth() > 0, style: { width: vwidth() + 'px', height: height() + 'px' }">
<a data-bind="attr: { href: '#' }, click: function(){ $parent.images.activateImage($index()) }">
<img data-bind="attr: { src: src }, style: { width: width() + 'px', height: height() + 'px', marginLeft: margin() + 'px' }" />
</a>
</div>
</script>
<script id="image_full_row" type="text/html">
<div class="full_width" data-bind="style: { width: $parent.images.containerWidth() + 'px' }">
<img data-bind="attr: { src: $parent.images()[$parent.images.activeImage()].src }" />
</div>
</script>
</body>