WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
Auto-open Easy Fancybox (5 posts)

  1. jerominrebatet
    Member
    Posted 1 year ago #

    Hello,

    After having several problem, here's my last one...
    http://www.starbasket.fr/photos-des-camps/camps-2007/la-baule-5/#729
    It keeps opening the first image of a gallery, not the one in the url (with the ID).
    There's a link "URL" with each pictures to get the ID.
    I can't find any option allowing me to change this setting.
    I want the auto open but only if an ID is passed by the url with the "#".

    Thank you for your help ;)
    Jeromin

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

  2. RavanH
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry, you are misunderstanding the use of id="fancybox-auto". You can only use this attribute once on each page. And it will cause that image to open on each page refresh independent of whatever hash tag is appended to the page URL.

    If you want to make hash values trigger fancybox you'll have to put some extra code in a text widget:

    <script type="text/javascript">
    window.onload = function() {
        if(window.location.hash) {
            jQuery(window.location.hash).trigger('click');
        }
    };
    </script>

    And change all those id="fancybox-auto" attributes so that each one has a unique value. But do not use a strictly numeric value. Use something like id="img270", id="img271" etc. or even unique names... and use corresponding hash values in the URL like http://www.starbasket.fr/photos-des-camps/camps-2007/la-baule-5/#img729

  3. jerominrebatet
    Member
    Posted 1 year ago #

    Actually,2 days ago, it works perfectly, but i had a compatibility problem with a plugin ...I also use nextgen-gallery.

    Now everythings works fine except the fact I can access an image with is ID in url.

  4. RavanH
    Member
    Plugin Author

    Posted 1 year ago #

    Your theme is incompatible as it includes its own FancyBox script.

  5. charlcfc
    Member
    Posted 1 year ago #

    Hi jerominrebatet

    Do you mind sharing the custom code you added to your fancybox for the link sharing and the copier code?

    Regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic