Is there any possibility to hide caption in photoswipe in desktop mode?

847 views Asked by At

On mobile I can tap once. Maybe something like shortcut? I'm trying add

ui.hideControls();

in photoswipe-ui-default.js, but there is no "onKeyDown" event.

1

There are 1 answers

0
Dmytro Semenov On
var gallery = new PhotoSwipe(...
gallery.init();
...


// set bottom gap to 0 (default is 'auto')
gallery.options.barsSize.bottom = 0;
// add class to root element of PhotoSwipe
gallery.framework.addClass( gallery.template, 'pswp__hidden-caption');
// force size update
gallery.updateSize(true);

.pswp__hidden-caption .pswp__caption {
    display:none;
}