# PhotoViewer
Open me!
Demo View | Source Code (opens new window) | Download all widgets
Assets:
Images:
CSS:
JavaScripts:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../core/lib/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../core/lib/ui/libs/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="photoviewer.js"></script>
<link rel="stylesheet" href="fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<link rel="stylesheet" href="style.css" type="text/css"/>
<title>Photo viewer</title>
</head>
<body>
<h1>Photo viewer</h1>
<div>
<a class="photo" rel="nofollow" href="images/big.jpg"><img src="images/small.jpg" alt="photo"/></a>
</div>
</body>
</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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.smile {
background: url("../core/images/smile.png") no-repeat;
height: 30px;
width: 250px;
margin-top: 10px;
float: left;
}
.smile a
{
position: relative;
margin-left: 40px;
font-family: arial,sans-serif;
text-decoration: none;
color: #000;
}
.smile .smile_text {
margin-top: 10px;
float: left;
}
.plus {
background: url("../core/images/plus.png") no-repeat;
height: 33px;
margin-top: 10px;
float: right;
}
.plus a
{
position: relative;
margin-left: 35px;
font-family: arial,sans-serif;
text-decoration: none;
color: #000;
}
.plus .plus_text {
margin-top: 10px;
float: right;
}
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
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
$(document).ready(function () {
function formatTitle() {
return '<div class=\"clear\"></div><div class=\"smile\"><div class=\"smile_text\"><a class=\"f12\" href=\"#\">Smile</a></div></div><div class=\"plus\"><div class=\"plus_text\"><a class=\"f12\" href=\"#\">Like</a></div></div>';
}
$("a.photo").fancybox({
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'padding': 10,
'speedIn': 600,
'speedOut': 200,
'titlePosition': 'over',
'titleFormat': formatTitle,
'overlayShow': false,
'onComplete': function () {
$('#fancybox-content')
.append('<img id="watermark-inner" src="../core/images/photo_watermark.png" style="position:absolute;right:20px;top:20px;" />');
}
});
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Make sure to add code blocks to your code group