<div style="height: 2000px;">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<%= DateTime.Now %>
<asp:Button ID="Button1" runat="server" Text="Button"
OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<div id="modalBackground"></div>
<div id="animationDialog">
<img src="animated_loading.gif" alt="Loading" />
Working on your request...
</div>
</ProgressTemplate>
</asp:UpdateProgress>
html
{
font-zize : 10pt;
font-family : Verdana;
}
#modalBackground
{
background-color : gray;
filter : alpha(opacity=70);
opacity : 0.7;
position : absolute;
top : 0px;
left : 0px;
}
#animationDialog
{
position : absolute;
border : solid 1px black;
color : Black;
background-color : #ffffae;
font-family : Arial;
font-size : 8pt;
font-weight : bold;
line-height : 30px;
height : 30px;
padding-left : 5px;
padding-right : 5px;
}
function getClientBounds()
{
var clientWidth;
var clientHeight;
switch(Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
clientWidth = document.documentElement.clientWidth;
clientHeight = document.documentElement.clientHeight;
break;
case Sys.Browser.Safari:
clientWidth = window.innerWidth;
clientHeight = window.innerHeight;
break;
case Sys.Browser.Opera:
clientWidth = Math.min(window.innerWidth,
document.body.clientWidth);
clientHeight = Math.min(window.innerHeight,
document.body.clientHeight);
break;
default: // Sys.Browser.Firefox, etc.
clientWidth = Math.min(window.innerWidth,
document.documentElement.clientWidth);
clientHeight = Math.min(window.innerHeight,
document.documentElement.clientHeight);
break;
}
return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);
}
function resizeElements()
{
var clientBounds = getClientBounds();
var clientWidth = clientBounds.width;
var clientHeight = clientBounds.height;
var bg = $get("modalBackground");
bg.style.width = Math.max(
Math.max(document.documentElement.scrollWidth, document.body.scrollWidth),
clientWidth) + 'px';
bg.style.height = Math.max(
Math.max(document.documentElement.scrollHeight, document.body.scrollHeight),
clientHeight) + 'px';
var scrollLeft = (document.documentElement.scrollLeft ?
document.documentElement.scrollLeft : document.body.scrollLeft);
var scrollTop = (document.documentElement.scrollTop ?
document.documentElement.scrollTop : document.body.scrollTop);
var dialog = $get("animationDialog");
dialog.style.left = scrollLeft + "px";
dialog.style.top = scrollTop + "px";
}
$addHandler(window, "scroll", resizeElements);
$addHandler(window, "resize", resizeElements);
resizeElements();
本文出自 “赵��” 博客,转载请与作者联系!