How to avoid the enlarge function of the PhotoSwipe lightbox?
Permalink Browser Info Environment
Hi,
I'm using the latest version of Grand Gallery with the PhotoSwipe lightbox. I would like to get rid of the enlarge functionality (plus icon) of the PhotoSwipe lightbox image. I would just like to have the grab cursor for swiping, not the enlargement. Is there a way to achieve this?
Thank you,
Michael
I'm using the latest version of Grand Gallery with the PhotoSwipe lightbox. I would like to get rid of the enlarge functionality (plus icon) of the PhotoSwipe lightbox image. I would just like to have the grab cursor for swiping, not the enlargement. Is there a way to achieve this?
Thank you,
Michael
Type: | Ticket |
---|---|
Status: | In Progress |
Thank you so much for your fast and helpful reply! I'm very happy with this solution!
Would it make sense to put such overrides in a custom block template?
May I also ask you how I would add the option "Click on image moves to the next slide"?
My attempts to achieve this with a similar approach have failed so far.
Would it make sense to put such overrides in a custom block template?
May I also ask you how I would add the option "Click on image moves to the next slide"?
My attempts to achieve this with a similar approach have failed so far.
1. View file is fine for styles.
I don't think you can override photo-swipe.js just by pasting it somewhere else.
2. You have to add this code around line 288 in packages/grand_gallery/blocks/grand_gallery/js_files/photo-swipe.js,
just below "gallery.init();"
Remember though, that after package update you will have to make those changes again.
I don't think you can override photo-swipe.js just by pasting it somewhere else.
2. You have to add this code around line 288 in packages/grand_gallery/blocks/grand_gallery/js_files/photo-swipe.js,
just below "gallery.init();"
// Go to next image when image in lightbox is clicked gallery.listen('close', function() { $('.gg-photo-swipe-wrapper').off('click', '.pswp__img'); }); $('.gg-photo-swipe-wrapper').on('click', '.pswp__img', function(){ gallery.next(); });
Remember though, that after package update you will have to make those changes again.
Thank you very much for the code, that helped me a lot.
Your support is amazing!
Your support is amazing!
currently you can't do it using UI, but you can modify file:
packages/grand_gallery/blocks/grand_gallery/js_files/photo-swipe.js
Add this code in line 246
and you have to add somewhere CSS code (it can be in page template, block template or paste it in /dashboard/system/seo/codes):
You can also disable zoom icon in /dashboard/grand_gallery/basic_settings
In "Lightbox settings" section