Do you mean https://www.ads-software.com/plugins/shiftnav-responsive-mobile-menu/?
It seems shiftnav changes the whole structure of the page, so any other plugins adding content (like Lightbox with PhotoSwipe) will be part of what shiftnav defines as “content” and not outside of it. On https://sevenspark.com/docs/shiftnav/javascript-api there is an API call which can be used to close the menu if needed. It should be possible to add this call to the event handler of PhotoSwipe which is in wp-content/plugins/lightbox-photoswipe/js/frontend.js
(used minified as frontend.min.js
).
This is just a wild guess – I did not check this yet:
jQuery(function($) {
var PhotoSwipe = window.PhotoSwipe,
PhotoSwipeUI_Default = window.PhotoSwipeUI_Default;
$('body').on('click', 'a[data-width]:has(img)', function(e) {
if( !PhotoSwipe || !PhotoSwipeUI_Default ) {
return;
}
e.preventDefault();
// Add this to close the shiftnav menu before opening the
// lightbox when clicking an image
if(typeof jQuery( '#shiftnav-main' ).shiftnav === 'function') {
jQuery( '#shiftnav-main' ).shiftnav( 'closeShiftNav' );
}
openPhotoSwipe( false, 0, this, false, '' );
});
...
If you modify your version of frontend.js
don’t forget to minify it again to frontend.min.js
or change the code in lightbox-photoswipe.php
so it will use frontend.js
and not the minified version.
Edit:
If this works, let me know and I’ll add this for the next update.
-
This reply was modified 4 years, 9 months ago by Arno Welzel.