View Full Version : jquery fancybox on page load

12-18-2009, 04:54 AM
Has anyone found a way to get Fancybox to display on page load?
There don't seem to be any options available in the docs.

Thanks in advance!!

12-18-2009, 05:28 AM
Yes I think you can do it. Google code is available over here:

12-18-2009, 05:36 AM
You can call this onpage load

Where the a.zoom part is your element your fancybox element.

12-18-2009, 07:51 AM
Where do I add the .click??

This is my code:

$(document).ready(function() { /* This is basic - uses default settings */ $("a#single_image").fancybox(); /* Using custom settings */ $("a#single_image").fancybox({ 'hideOnContentClick': true }); $("a.group").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false }); });

That shows an image when clicking on the single_image link. I want to avoid any clicking so I am thinking an invisible link with the single_image id which is clicked automatically onload of the page.


12-23-2009, 08:31 PM
I think fancybox loads itself once you have included the
<script type="text/javascript" src="./fancybox/jquery.fancybox-1.2.6.pack.js"></script>. Try look into that .js, down to most bottom:

$(document).ready(function() {
ieQuirks = $.browser.msie && !$.boxModel;

if ($("#fancy_outer").length < 1) {

12-24-2009, 05:53 PM
I got it to work using a cookie

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum