Closing Shadowbox then Redirect

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Closing Shadowbox then Redirect

slinkyart
This post was updated on .
Hey all,

Thank you in advance for your help with my conundrum. I am trying to redirect my parent page after closing Shadowbox and I think I'm close, but it's not working properly...when I click my button with the Shadowbox code on it, it redirects to my page first, then if I hit the back button, then the Shadowbox appears. So something is crossed, please help:

<script type="text/javascript">
function moveCloseLink(){
    var cb=document.getElementById('sb-info');
    $(cb).css("position","absolute");
    $(cb).css("right","0");
    $(cb).css("top","0");
    $(cb).css("z-index","100");
    window.parent.location.href = 'success-yes.php';
}
Shadowbox.init({
        onOpen: moveCloseLink
});
</script>

Thank you!
Mike