Is it possible to prevent colorbox from being closed? I am using as a loading screen for a server side processing script and don't want it to be closed until finished.
$(function(){
$("#songPayBtn").click(function() {
$("#ccResultDiv").show();
$.fn.colorbox({width:"50%",
height:"50%",
inline:true,
href:"#ccResultDiv",
onClosed:function(){ <?php echo "window.location = \"http://rt.ja.com/trackdownload.php?trackid=" . $_SESSION['trackid'] . "\"";?> }
});
You can prevent your colorbox from closing and hide the close button by adding these options:
$("#myColorbox").colorbox({
escKey: false, //escape key will not close
overlayClose: false, //clicking background will not close
closeButton: false // hide the close button
});
This will also allow you to still use the $.colorbox.close()
method when you are ready to close your colorbox.
It is indeed. You can redefine the close method before anything is initialized:
$.fn.colorbox.close = function(){};
This has to occur before the $(document).ready()
function since it's during this that colorbox will take care of assigning its close method to elements and events.
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