I am trying to get colorbox (iframe) to close and for it to redirect the parent window to a specific page that is dynamically depending on the image that is being displayed in the colorbox. So basically each image with have a link next to so the user can click to go to the owner of the image profile.
I have got it so it closes the colorbox but not redirecting the parent window.
<a href='#' onclick='parent.$.colorbox.close(); window.parent.location.href=linkurl;'> owner profile</a>
Any help or pointers would be appreciated. Thanks
I am trying to get colorbox (iframe) to close and for it to redirect the parent window to a specific page that is dynamically depending on the image that is being displayed in the colorbox. So basically each image with have a link next to so the user can click to go to the owner of the image profile.
I have got it so it closes the colorbox but not redirecting the parent window.
<a href='#' onclick='parent.$.colorbox.close(); window.parent.location.href=linkurl;'> owner profile</a>
Any help or pointers would be appreciated. Thanks
Share Improve this question asked Sep 11, 2013 at 20:39 shukashuka 1352 silver badges8 bronze badges 2- There are like hundreds of questions about redirecting from iframe (think we get one every day), just use the search feature next time, please... – UIlrvnd Commented Sep 11, 2013 at 20:42
- thanks Stefan, yes I have just spend a couple of hours going through them and could not find one that was using a link, as most are using forms – shuka Commented Sep 11, 2013 at 20:49
2 Answers
Reset to default 6Try this:
<a href="#" id="myLink">click</a>
jQuery('#myLink').click(function(){
jQuery.colorbox.close();
window.location.href = 'http://yourlink.';
});
You could probably remove the window.location and just give youre a tag a link.
Try to replace window.parent.location.href=linkurl;
with opener.location.href=linkurl;