WordPress.org

Forums

Easy FancyBox
[resolved] Need Nav off everywhere but gallery pages (5 posts)

  1. markrand
    Member
    Posted 3 years ago #

    I'm using Fancybox everywhere by default and love it. However, now I'm adding standard WP galleries using the [ gallery ] tag. I'd like to turn on the navigation arrows so users can go from image to image. However, all over the rest of my site I do not want navigation because the image links on other pages are are unrelated (and many are just text links that I don't want users to come across unless they specifically click the text link).

    I've read the other posts and haven't figured it out. I did see where some JQuery code was used to turn off FB for a page. Could this same idea be used just to turn off the nav arrow functionality for a whole page? I could do it page by page but cannot do "rel" image by image because there are a zillion in a page.

    Thanks for any help you can provide. I love the this plugin.

    http://wordpress.org/extend/plugins/easy-fancybox/

  2. RavanH
    Member
    Plugin Author

    Posted 3 years ago #

    Hi,

    What you are looking for is actually not implemented as an easy switch yet but there should be a way:

    1. Go to Settings > Media and switch the option "Auto-gallery" to "Galleries per Section"
    2. Then in the field "Section(s)" replace the default values with .gallery
    3. Save

    From then on, images will NOT be linked into a gallery in FancyBox (with those arrows) unless they are part of a WordPress gallery.

    Hope that helps you out :)

  3. markrand
    Member
    Posted 3 years ago #

    Ravan,

    You are awesome! It works great. I actually decided to switch to NextGen Gallery from the built-in WordPress gallery. Your trick works there too. For others who may come across this, the correct value for NGG to put in the "Section(s)" field is "div.ngg-galleryoverview".

    One other question. For those images that are not in a gallery (thus have no arrow overlay), I'd really like to have "click to close" active, meaning that the image closes if the user clicks anywhere on the image as well as anywhere outside the image. The reason is that I was watching the wife test my site (she works cheap!) and as she was going through and looking at various images (there are a lot), she was laboriously 'mouse-hunting' the "X" circle each time. Since my images are all different sizes and aspect ratios the "X" target is always in a different place.

    It appears people don't always know or remember to try just clicking anywhere outside the box. Since I'm going to have a fair number of non-techie users this is an issue that would be cool to solve. Ideally, when "click to close" is active there would be an option to stop the "X" close circle appearing. In my experience, if a user has a popup image appear with no chrome, they will try just clicking on the image itself first.

    I looked and found that Fancybox itself has an option to do this and I found where Easy Fancybox appears to set it to false and I tried to hack the code to turn it on but my PHP kung fu is weak and I failed. Is a click-to-close option something you might consider in a future rev of Easy Fancybox? I realize that it's probably not trivial to implement because it's conditional and only desired when the window content does not need interaction (iframe, video, gallery etc).

    Either way, thanks for considering it and thanks especially for this great plugin.

  4. RavanH
    Member
    Plugin Author

    Posted 3 years ago #

    Hi Mark,

    Thanks for sharing the "div.ngg-galleryoverview" section for NextGEN galleries :)

    About the 'close on content click' option: that is not currently implemented in my plugin. I had planned it for a next release but because that a complety new FancyBox 2 script has been released my priority has now changed to integration of the new script into my plugin... It should be end of this month that I have time to work on this and I aim to integrate 'close on content click' at the same time...

    Allard

  5. SandyMe
    Member
    Posted 2 years ago #

    This helped me a lot. Thank you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic