Want to show Custom wait control at center of page

旧街凉风 提交于 2019-12-11 17:33:14

问题


I got the trick from stackoverflow to hide the loading message by manipulating the DOM with jQuery. Adding the following script to the page with the reportviewer did the trick:

<script type="text/javascript">
$(function () {
    var waitMsg = $("div[id$='AsyncWait_Wait']");
    waitMsg.wrap("<div style='display:none; visibility: hidden'></div>");
});

rather i want to show my own message and image at center of page. just guide me how to show my message before rendering report in my page. which method i need to hook. onwindowload something like.


回答1:


You can do that by using css

<style type="text/css" media="screen">
/* commented backslash hack for ie5mac \*/ 
html, body{height:100%;} 
/* end hack */
.CenterPB{
position: absolute;
left: 50%;
top: 50%;
margin-top: -30px; /* make this half your image/element height */
margin-left: -30px; /* make this half your image/element width */
}
</style>

and you have the progress bar in the div

$(function () {
    var waitMsg = $("div[id$='AsyncWait_Wait']");
    waitMsg.wrap("<div class='CenterPB' 
      style='display:none;height:60px;width:60px;'>Message here</div>");
});

reference:
http://www.sitepoint.com/forums/1243542-post9.html
http://www.search-this.com/2008/05/15/easy-vertical-centering-with-css/

Making Update Progress Panel in the center




回答2:


You could just add it to the same exact function. Something like

$(function() {
//Get message ref
var waitMsg = $("div[id$='AsyncWait_Wait']");

//Add custom message
var customMessage = $(document.createElement("div"));
customMessage.text("My message...");
waitMsg.before(customMessage);

//Hide message
waitMsg.wrap("<div style='display:none; visibility: hidden'></div>");
});


来源:https://stackoverflow.com/questions/9377305/want-to-show-custom-wait-control-at-center-of-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!