aspx代码:
<td>
<asp:Button ID="BtnDownPPT" runat="server" OnClientClick="ShowPPT();" Text=" 公报下载 "
Visible="false" />
</td>
…………
<asp:Button ID="Btn_DownPPT" runat="server" Text=" 公报下载 " CssClass="displayNone"
OnClick="Btn_DownPPT_Click" />
…………
<div id='pageBase_Div' style='display: none; z-index: 12001; text-align: center;
font-size: large; vertical-align: middle; position: absolute; left: 400px; top: 200px;
padding: 5px 6px 0px 6px; border: 1px solid blue;' runat="server">
<table>
<tr>
<td>
<img alt="请稍候......" src="../../App_Themes/Green/Images/loading.gif" />
</td>
<td valign="middle">
正在下载报表,请稍候......
</td>
</tr>
</table>
</div>
<iframe id="pageBase_iframe" src="" scrolling="no" frameborder="0" style="position: absolute;
top: 200px; left: 400px; display: none;" runat="server"></iframe>
js:
function showDownPPT() {
// debugger;
$("#Btn_DownPPT").click();
document.getElementById('divContent').style.display = 'none';
var nums = document.getElementById("div_QueryCon");
var buttons = nums.getElementsByTagName("input");
for (var i = 0; i < buttons.length; i++) {
buttons[i].style.color = "#000000"; //将按钮字体变黑
buttons[i].disabled = true;
//所有按钮都置为不可用,所以不能再按钮中加入OnClick="Btn_DownPPT_Click"事件,所以要先触发 $("#Btn_DownPPT").click();
}
document.getElementById('BtnDownPPT').style.color = "#FF0000"; //下载按钮字体变红色
var pagebase_div = document.getElementById('pageBase_Div');
var pagebase_iframe = document.getElementById('pageBase_iframe');
pagebase_div.style.display = "block";
pagebase_iframe.style.width = pagebase_div.offsetWidth;
pagebase_iframe.style.height = pagebase_div.offsetHeight;
pagebase_iframe.style.top = pagebase_div.style.top;
pagebase_iframe.style.left = pagebase_div.style.left;
pagebase_iframe.style.zIndex = pagebase_div.style.zIndex - 1;
pagebase_iframe.style.display = "block";
setTimeout("HideDownPPT()", 70000); //默认70秒
}
function HideDownPPT() {
// debugger;
var pagebase_div = document.getElementById('pageBase_Div');
var pagebase_iframe = document.getElementById('pageBase_iframe');
pagebase_div.style.display = "none";
pagebase_iframe.style.display = "none";
var nums = document.getElementById("div_QueryCon");
var buttons = nums.getElementsByTagName("input");
for (var i = 0; i < buttons.length; i++) {
buttons[i].style.color = "#000000"; //将按钮字体变黑
buttons[i].disabled = false;
}
document.getElementById('divContent').style.display = 'block';
}