Home > Featured > How to launch fancybox automatically when a page is loaded
Bookmark and Share

How to launch fancybox automatically when a page is loaded

Posted on February 08, 2013 | Filed in Featured, jQuery

Put this in between the <head></head> tags.

<script type=”text/javascript”> $(document).ready(function() { $(“#my_fancybox_id”).fancybox().trigger(‘click’);< }); </script>

In the body/content area put in a link. Hide it if you like.

<a href=”#my_content_div” id=”my_fancybox_id”>Click to display div</a>

Then create the target content div:

<div id=”my_content_div”>Content goes here.</div>

Leave a Reply

Contact Us

Big Apple Design Group
134 West 29th Street
Third Floor
New York, NY 10001

[email protected]

Search Blog