WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
Trouble with auto-launch on page load (5 posts)

  1. radfan957
    Member
    Posted 3 years ago #

    I have tried unsuccessfully for three days to get a gallery to auto-load when the page is opened. I have followed the instructions on the developer's website with no success. I have even tried variants hoping that I just did not understand something. Here is the code that I am using:

    <div style="display:none" class="fancybox-hidden"><div id="fancybox">
    </div></div>
    <a href="#fancybox-auto" class="fancybox"></a>

    Somebody please help and reply with the correct code to perform this function. Thank you so much in advance!!!

  2. RavanH
    Member
    Plugin Author

    Posted 3 years ago #

    You've got class and href mixed up. Use:

    Then the empty div should open in FancyBox on page load. But keep in mind, it's an empty div there. No gallery.

  3. radfan957
    Member
    Posted 3 years ago #

    Thank you for the response. I have very light experience in coding. What is the proper code with placement of a gallery? Please give an example that includes a gallery in the code.

  4. RavanH
    Member
    Plugin Author

    Posted 3 years ago #

    There are lots of ways for you to create a gallery on a WordPress page.

    For example, you can use the shortcode [gallery link="file"] and WordPress will automatically create a gallery of all images that are attached to that post/page. FancyBox will automatically be enabled for each of those images and if you set the plugin option Auto-open to "First Image link" it should open the first image on page load...

    Other methods include manual insertion of hidden image links in combination with only one thumbnail image to open a complete gallery in FancyBox. Or you can use the plugin NextGEN Gallery and integrate it with FancyBox. There are instructions in the Easy FancyBox FAQ page for that.

  5. radfan957
    Member
    Posted 3 years ago #

    I stated in my original post that I tried the code on the Easy Fancybox FAQ and I was not successful. I understand how to create a gallery. I just don't understand the proper syntax for the link and div. What I need is the proper code to accomplish this goal.

    Thank you for your time. I have since found a solution that works perfectly for me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic