I got the solution as below;
Call it on ready function.
var checkImageLoad = false ;
var counter;
counter = setInterval(checkLoading, 1000); //1000 will run it every 1 seconds
var count = 0;
function checkLoading() {
count = count + 1;
if (count >= 10 && checkImageLoad == false)
{
Confirm();
clearInterval(counter);
return;
}
}
//Creates Confirm Box when there is a delay in image loading
function Confirm() {
$("#divConfirm").dialog({
modal: true,
width: 500,
resizable: false,
buttons: [{
text: 'Yes',
click: function () {
$(this).dialog('close');
}
},
{
text: 'No',
click: function () {
//Write your code what you want to do if NO
}
}]
});
$(".ui-dialog-titlebar").text("Confirm");
$(".ui-dialog-titlebar").css("text-align", "center");
$(".ui-widget-content").css("padding-left", 5);
$(".ui-widget-content").css("padding-right", 5);
}