Skip to content

Commit

Permalink
🐛 Fix: add no-fancybox className to avoid the effect with fancybox.js
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #211
  • Loading branch information
Molunerfinn committed Jan 29, 2020
1 parent 01dad37 commit e620a07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"stylusSupremacy.sortProperties": "grouped",
"eslint.autoFixOnSave": true,
"stylusSupremacy.quoteChar": "\""
}
}
21 changes: 7 additions & 14 deletions source/js/fancybox.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
$(function () {
var imgList = $('.recent-post-item img')
var imgList = $('.recent-post-item img').not('.no-fancybox')
if (imgList.length === 0) {
imgList = $('#post-content img')
imgList = $('#post-content img').not('.no-fancybox')
}
for (var i = 0; i < imgList.length; i++) {
var $a = $(
'<a href="' +
imgList[i].src +
'" data-fancybox="group" data-caption="' +
imgList[i].alt +
'" class="fancybox"></a>'
imgList[i].src +
'" data-fancybox="group" data-caption="' +
imgList[i].alt +
'" class="fancybox"></a>'
)
var alt = imgList[i].alt
var $wrap = $(imgList[i]).wrap($a)
Expand All @@ -22,14 +22,7 @@ $(function () {
selector: '[data-fancybox]',
loop: true,
transitionEffect: 'slide',
buttons: [
"share",
"slideShow",
"fullScreen",
"download",
"thumbs",
"close"
],
buttons: ['share', 'slideShow', 'fullScreen', 'download', 'thumbs', 'close']
})

var galleryItem = $('.gallery-item')
Expand Down

0 comments on commit e620a07

Please sign in to comment.