CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   jquery fancybox on page load (http://www.codingforums.com/showthread.php?t=184821)

mapleleaf 12-18-2009 04:54 AM

jquery fancybox on page load
 
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!!

SSJ 12-18-2009 05:28 AM

Yes I think you can do it. Google code is available over here:
http://code.google.com/p/fancybox/do...ybox-1.2.6.zip

_Aerospace_Eng_ 12-18-2009 05:36 AM

You can call this onpage load
Code:

$('a.zoom').click();
Where the a.zoom part is your element your fancybox element.

mapleleaf 12-18-2009 07:51 AM

Where do I add the .click??

This is my code:

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.

Thanks.

hdewantara 12-23-2009 08:31 PM

Hi,
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:
PHP Code:

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

                if ($(
"#fancy_outer").length 1) {
                        $.
fn.fancybox.build();
                }
        });
... 


stiplayer 12-24-2009 05:53 PM

I got it to work using a cookie


All times are GMT +1. The time now is 06:55 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.