I am triggering the fancybox to open onclick
like this:
$('.telefonosOtrosPaises').fancybox({
'type' : 'iframe',
'href' : 'http://es.solmelia.com/nMenus/jsp/telefonosOtrosPaises.jsp',
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
/*'easingIn' : 'easeInOutBack',
'easingOut' : 'easeInOutBack', */
/*onComplete : function(){ $('#fancybox-content').css({'height':'380px','width':'570px','background':'white','padding':'20px'})}*/
onComplete : function(){ $('#fancybox-content').css({'width':'630px','background':'white','paddingTop':'15px'})}
});
but how can i just open it in my js code when i need it?
Instead of calling .fancybox
on an element, call it like this:
$.fancybox.open(...)
Note this is fancybox 2 syntax, although it might work with v1
If you want to have it open on both onclick
and when prompted in your code, just call click
on the element you've attached it to.
$('.telefonosOtrosPaises').click();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With