Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-18-2009, 04:54 AM   PM User | #1
mapleleaf
New Coder

 
Join Date: May 2009
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
mapleleaf is an unknown quantity at this point
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!!
mapleleaf is offline   Reply With Quote
Old 12-18-2009, 05:28 AM   PM User | #2
SSJ
Regular Coder

 
Join Date: Mar 2007
Posts: 230
Thanks: 0
Thanked 4 Times in 4 Posts
SSJ is an unknown quantity at this point
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
__________________
Best Joomla Design Agency India ||PSD to Joomla Template || Award Winning Web Design Company India
SSJ is offline   Reply With Quote
Old 12-18-2009, 05:36 AM   PM User | #3
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
You can call this onpage load
Code:
$('a.zoom').click();
Where the a.zoom part is your element your fancybox element.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 12-18-2009, 07:51 AM   PM User | #4
mapleleaf
New Coder

 
Join Date: May 2009
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
mapleleaf is an unknown quantity at this point
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.

Last edited by mapleleaf; 12-18-2009 at 07:53 AM..
mapleleaf is offline   Reply With Quote
Old 12-23-2009, 08:31 PM   PM User | #5
hdewantara
Regular Coder

 
hdewantara's Avatar
 
Join Date: Aug 2009
Location: Jakarta, Indonesia.
Posts: 287
Thanks: 4
Thanked 39 Times in 39 Posts
hdewantara is an unknown quantity at this point
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();
                }
        });
... 
hdewantara is offline   Reply With Quote
Old 12-24-2009, 05:53 PM   PM User | #6
stiplayer
New Coder

 
Join Date: Nov 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
stiplayer is an unknown quantity at this point
I got it to work using a cookie
stiplayer is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Advertisement
Log in to turn off these ads.