• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JQuery ColorBox, iframe to parent issue..........................


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:
$(".login").colorbox({transition:"none", width:"60%", height:"80%", iframe:true});

The iframe page is using this 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
[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.


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
<a href="whateverepage.html" target="_top">

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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.