Refresh page when closing colorbox

I use colorbox, and I want to refresh the page when it is closed, so I try something like this:

    $.colorbox({href:"loading.html",title:'send notification...',escKey:false,width:300,height:00,
overlayClose:false,onClosed:location.reload(true)});
                $.ajax({
                   url: "sendNot.php",
                   type: "POST",
                   data: {titolo:titolo.value,messaggio:messaggio.value},
                   success: setTimeout("parent.$.colorbox.close()",5000)
                }); 

if I remove the onclosed option, after 5 seconds the color code will be deleted, but at the same time, like the code, it will close when ajax stops loading the page in the message. What is the problem? can you help me? None?: (

+5
source share
2 answers

Try the following:

$.colorbox({href:"loading.html",title:'send notification...',escKey:false,width:300,height:00,
overlayClose:false,onClosed:function() { location.reload(true); }});

, - onClosed, . - , / ( ). .

    $.colorbox({href:"loading.html",title:'send notification...',escKey:false,width:300,height:00,
    overlayClose:false,onClosed:reloadPage});

function reloadPage() {
    location.reload(true); 
}
+12

colorbox

$(document).ready(function(){
    $('.iframe').colorbox({
        iframe:true,
        width:'700px',
        height:'800px',
        onClosed:function(){ location.reload(true); },
    }); 
});
+4

All Articles