call fancybox from onClick..

478 vues
Accéder directement au premier message non lu

huglester

non lue,
28 déc. 2009, 03:30:3528/12/2009
à fancybox
Hello everyone.

Thanks for this nice lib, but I came into some problems...
Currently I'm using the code:
$("a.group").fancybox({ 'hideOnContentClick': false, 'zoomSpeedIn':
300, 'zoomSpeedOut': 300, 'overlayShow': false });

and it is working nice, but.... I want to add a button:
<a href="#" onclick="...">View gallery</a>, which would run the
appropriate gallery. and don't know how is it done :(

I tried this,
$("a.emulateclick").click(function () {
var rel = $(this).attr('id');
$("a").attr('rel', rel).click();
});

the id of the a.emulateclick was holding rel name of the fancybox
gallery...
It emulates lick, start gallery, but does not allow you to swich
photos, close fancybox.. etc.

so I thought maybe the is something like:
onclick=fanxybox.start('rel-name-of-the-gallery');

I'm sure somebody already solved this issue!:)
thanks!

cheers,
Jaroslav

Janis

non lue,
1 janv. 2010, 14:50:4701/01/2010
à fancybox
You could try $("a.group:first").trigger('click');

Janis

huglester

non lue,
2 janv. 2010, 07:11:2802/01/2010
à fancybox
Thanks mate,
I think I didn't get responce by email about your post.. So I visited
it :)

but your reply did help me :)
thank you so much!:)
I was playing with $("a.group").fancybox().trigger('click'); - with
no luck..
I was able only to bind only 1 photo, now I understand why :)

Thank you very much and happy new year!

Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message