-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfancy-box.js
More file actions
30 lines (23 loc) · 753 Bytes
/
fancy-box.js
File metadata and controls
30 lines (23 loc) · 753 Bytes
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
$(document).ready(function() {
$('.content img').not('.group-picture img').each(function () {
var $image = $(this);
var imageTitle = $image.attr('title');
var $imageWrapLink = $image.parent('a');
if ($imageWrapLink.size() < 1) {
$imageWrapLink = $image.wrap('<a href="' + this.getAttribute('src') + '"></a>').parent('a');
}
$imageWrapLink.addClass('fancybox');
$imageWrapLink.attr('rel', 'group');
if (imageTitle) {
$imageWrapLink.append('<p class="image-caption">' + imageTitle + '</p>');
$imageWrapLink.attr("title", imageTitle); //make sure img title tag will show correctly in fancybox
}
});
});
$('.fancybox').fancybox({
helpers: {
overlay: {
locked: false
}
}
});