I'm using Fancybox to open a pop-up that allows the user to choose between two different methods of logging on to a site. I'd like clicking either of the links in the Fancybox to close the fancybox and open the link back in the parent web page.
Is this possible?
Here's how I'm opening the FancyBox box:
$("#logonChooser").click(function () {
$.fancybox.open({
href: 'LogonChooser.html',
type: 'iframe',
padding: 5
});
});
Here's the LogonChooser.html:
<head>LogonChooser.hmtl</head>
<body>
<a href="LogInDatabase.html">Log In</a>
<a href="LogInFacebook.html">Log In Facebook</a>
</body>
I can close the fancybox like so:
<a href="LogInDatabase.html" onclick="parent.$.fancybox.close();">Log In</a>
but I don't get the link back in the parent page.I'd like clicking on either of the links to close the fancybox and open the link in the page that spawned the fancybox, rather than inside the fancybox.
Any help is appreciated. I'm using Fancybox 2 if that helps, but am open to using the previous version if that is easier.
It should be sufficient when you add this to the links:
target="_parent"
The linked page now will be opened in the parent page, no need to close the fancybox, because the fancybox will be replaced(it's also a part of the parent page)
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