WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
most basic fancybox usage (2 posts)

  1. Gabe462
    Member
    Posted 1 year ago #

    shouldn't the following open the selected element in a modal window?

    jQuery('#element-id').fancybox();

    I've got a hidden div, and I want to display it when another element is clicked. But I can't even get the above to work. Am I missing something obvious?

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

  2. RavanH
    Member
    Plugin Author

    Posted 1 year ago #

    That code will bind fancybox to the element but it does not trigger an actual click event. You would need something like this maybe:

    jQuery('#element-id').fancybox().trigger('click');

    But it all depends on what that element actually is... Is it a link to your inline content? Then just give it a id="fancybox-auto" instead and activate the Auto-open feature in the FancyBox settings.

    Read 'Can I make an image or hidden content to pop up in FancyBox on page load?' on http://wordpress.org/extend/plugins/easy-fancybox/faq/ for more...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic