Title: Issues with Shiftnav
Last modified: February 12, 2020

---

# Issues with Shiftnav

 *  [Dan Davies](https://wordpress.org/support/users/dansiop/)
 * (@dansiop)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/issues-with-shiftnav/)
 * Hey first all thanks for an awesome plugin – this is really good.
 * Got a slight issue, when the lightbox is open, the shiftnav bar is over the icons
   at the top meaning it is not easy for user to exit the lightbox. I know they 
   can swipe down to get rid of it but ideally I wanted the lightbox above the shiftnav
   but not sure how to do this as the lightbox is coded inside the shiftnav body
   and not outside it.
 * I am trying to do some kind of javascript to hide the shiftnav bar when lightbox
   is activated but is there a solution to this?
 * Thanks in advance.
 * Dan

Viewing 1 replies (of 1 total)

 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/issues-with-shiftnav/#post-12425697)
 * Do you mean [https://wordpress.org/plugins/shiftnav-responsive-mobile-menu/](https://wordpress.org/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](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 6 years, 3 months ago by [Arno Welzel](https://wordpress.org/support/users/awelzel/).

Viewing 1 replies (of 1 total)

The topic ‘Issues with Shiftnav’ is closed to new replies.

 * ![](https://ps.w.org/lightbox-photoswipe/assets/icon-256x256.png?rev=2906302)
 * [Lightbox with PhotoSwipe](https://wordpress.org/plugins/lightbox-photoswipe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lightbox-photoswipe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lightbox-photoswipe/)
 * [Active Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lightbox-photoswipe/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/issues-with-shiftnav/#post-12425697)
 * Status: not resolved