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
Try this:
<a href="#" id="myLink">click</a>
jQuery('#myLink').click(function(){
jQuery.colorbox.close();
window.location.href = 'http://yourlink.com';
});
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;
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