It’s time for some more technical web design stuff: When you use Colorbox for overlaying content in an iframe over the main website, you might want to link to another page in this iframe. If you do this, the new page will be shown in the same iframe with the colorbox design around it. Now if this new page doesn’t fit in the iframe, this will look quite messy and won’t be usable. So you want to open the new page in the parent window, but how to do this? The solution is quite simple, no JavaScript needed:
<a href="NEW SITE" target="_top">open in parent window</a>
By defining the target as _top, the iframe will be left and the site will be opend in the parent window. However, as colorbox usually opens and closes with an animation, you might want to animate the closing of colorbox. This is done by a simple JavaScript command:
<a onclick="parent.$.fn.colorbox.close();" href="NEW SITE" target="_top"> open in parent window with animation </a>
Wow, this is the simplest solution to a problem I was having for a long time! Thanks!
Thanks Dude.. u solved my problem..
Great work dude… U saved my time…
Cheeeeeeers…
VERY NICE DUDE =D
You save my life hehehe … thanks!!!
Great dude! thank you…
Awesome! This was a re-accuring issue for a while. Worked GREAT! Thankx
OMG !! THANK YOU BERRY BERRY MUCH !!
Thanks for the tip! One note,
If you’re doing this in WordPress, you probably need to change:
parent.$.fn.colorbox.close()
to
parent.jQuery.fn.colorbox.close()
Otherwise, great job. Thanks.
Thank you !
Hi, big THANKS from Prague.
Works! Thank you!!!
Thanks , this solution provides great help…!!
pure genius – thank you!
Bless you!
Thanks, saved my life!!!
Thanks you are great
Hi,
I have a very big problem, I’m developping a site web and I’m using colorbox plugin. It’s very nice, but I have a big problem with Google Chrome browser because :
parent.$.fn.colorbox.close() doesn’t work in Google Chrome
Please help me to find a solution to this issue !
Thanks
This is the error I have :
Uncaught TypeError: Cannot read property ‘fn’ of undefined
help !
I solved it by using target=”_parent” to close and open in the parent page or target=”_blank” to open on a new page
wonderfull thank you very match
thanks!!
tried a lot javascripting
didn’t realize a simple target attribute could do the job.
great share!!!
Thank you – Solved my problem perfectly