I am trying to implement navigation between posts using the instructions here: http://reallysimpleworks.com/blog/navigating-between-blog-posts-with-jquery-keyboard-shortcuts/
It works, except I also have a lightbox post gallery on the page (using the Hatch theme). So if I open lightbox and navigate between photos using the left and right arrows, it triggers the navigation between blog posts already but only goes to the next page once the lightbox is closed.
I want to be able to keep these two navigation actions separate – perhaps having the post navigation be disabled while the lightbox is opened, though I’m not sure how this would be done.
Thanks so much in advance!
The navigation works by associating (binding) script to run on a particular key event. To do what you want, you need to attach your own script to run when the lightbox opens that removes the previous key binding. Then another script when the lightbox closes to restore the binding.
Thanks so much for the info! I don’t have much experience with the intricacies of Lightbox, so how would I be able to detect with Lightbox is opened/closed from outside of the Lightbox script itself?
Either way, you need to bind your own function to some event that happens when the lightbox opens. This could be a click on a thumbnail, or some element in the lightbox getting focus, or probably other events as well. After all, lightbox is triggered by some event itself. Unfortunately, I’m not well versed in Lightbox or jQuery. I only know enough to be certain there is way to accomplish this and have a vague idea of what needs to happen, so I can’t really give you any specifics, sorry.
- The topic ‘Keyboard post navigation with Cleaner (Lightbox) Post Gallery’ is closed to new replies.