Welcome Guest, Not a member yet? Register   Sign In
JQuery ColorBox, iframe to parent issue..........................
#1

[eluser]Otemu[/eluser]
Hi,

I have a login screen for my Codeigniter site, the login overlays my main home page in an iframe. I need the following to happen, once a user enters the correct login details, the iframe should close and redirect them to the account page.

My homepage is setup with this code:
Code:
$(".login").colorbox({transition:"none", width:"60%", height:"80%", iframe:true});

The iframe page is using this code:
Code:
<a >Open from parent</a>

This closes the iframe but opens another iframe, so I must be missing some small detail. Alternatively I could use
Code:
[removed] if (top.location != self.location) { top.location = self.location.href;}[removed]
on the page that I am directing to which works, but that seems a bit messy.

Any help be great.

Thanks
#2

[eluser]Otemu[/eluser]
After trying a number of things, turns out it was such a simple solution afer all :red:

Doesn't even require any JavaScript, just set the target to top
Code:
<a href="whateverepage.html" target="_top">

or JavaScript method
Code:
onclick='parent.document.location.href = "whateverpage.html"




Theme © iAndrew 2016 - Forum software by © MyBB