aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorolOwOlo <26087907+olOwOlo@users.noreply.github.com>2017-09-06 17:20:16 +0800
committerolOwOlo <26087907+olOwOlo@users.noreply.github.com>2017-09-06 17:20:16 +0800
commit8137021405dffb6505881eb0d469fce1b1725617 (patch)
tree3d932b666ea3b193a3d912184e0da72dc18c14d1 /src
parent6a66b73a437ff4f5e450da2cf15a92e502bcd44a (diff)
feat: group images with fancybox
Diffstat (limited to 'src')
-rw-r--r--src/js/even.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/js/even.js b/src/js/even.js
index 5538661..6aef540 100644
--- a/src/js/even.js
+++ b/src/js/even.js
@@ -114,13 +114,13 @@ Even.fancybox = function () {
if ($.fancybox) {
$('.post').each(function () {
$(this).find('img').each(function () {
- $(this).wrap('<a class="fancybox" href="' + this.src + '" title="' + this.alt + '"></a>')
+ $(this).wrap(`<a class="fancybox" href="${this.src}" data-fancybox="gallery" data-caption="${this.title}"></a>`)
})
})
$('.fancybox').fancybox({
- openEffect: 'elastic',
- closeEffect: 'elastic'
+ selector: '.fancybox',
+ protect: true
})
}
}