narasiman rao

narasiman rao

  • NA
  • 519
  • 768.8k

hide the progress bar in background

May 5 2016 10:08 PM
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
function ShowProgress() {
setTimeout(function () {
var modal = $('<div />');
modal.addClass("modal");
$('body').append(modal);
var loading = $(".loading");
loading.show();
var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
loading.css({ top: top, left: left });
}, 200);


}

$('form').live("submit", function () {
ShowProgress();
});



function ShowProgress() {
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(hideMethod);
}


function hideMethod() {
$('#loading').hide();
}



When click the export button popup will open in that popup open and save button is there.

When i click the open button progress bar will appear and then excel file will open
And close that excel file in background that progress bar is showing
For hiding the progress bar in background i written code as follows


function ShowProgress() {
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(hideMethod);
}

function hideMethod() {
$('#loading').hide();
}

When i write the above code then when i execute and run at the time of click the open button in popup, that progress bar is not showing
for that how can i do.

i want after closing that excel in background the progress bar will not be shown
at the time of click the open button in popup progress bar will be displayed

Answers (2)