在javascript中回发期间锁定内容页面 [英] Lock content page during post-back in javascript

查看:72
本文介绍了在javascript中回发期间锁定内容页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了如何锁定内容页面,同时页面回发并获得以下代码,



I googled about how to lock content page while page post back and got the following code,

function showLoading() {
    var windowWidth = 0;
    var windowHeight = 0;

    if ((document.documentElement) && (document.documentElement.clientWidth))
        windowWidth = document.documentElement.clientWidth;
    else if ((document.body) && (document.body.clientWidth))
        windowWidth = document.body.clientWidth;
    else if ((document.body) && (document.body.offsetWidth))
        windowWidth = document.body.offsetWidth;
    else if (window.innerWidth)
        windowWidth = window.innerWidth - 18;

    if ((document.documentElement) && (document.documentElement.clientHeight))
        windowHeight = document.documentElement.clientHeight;
    else if ((document.body) && (document.body.clientHeight))
        windowHeight = document.body.clientHeight;
    else if ((document.body) && (document.body.offsetHeight))
        windowHeight = document.body.offsetHeight;
    else if (window.innerHeight)
        windowHeight = window.innerHeight - 18



    document.getElementById('blackOut').style.display = 'block';
    var height = windowHeight + "px";
    alert(windowHeight + " " + windowWidth);
    document.getElementById('blackOut').style.height = height;
    document.getElementById('blackOut').style.width = windowWidth + "px";
}



-------------------------- -------------------------------------------------- --------------------

和我的html停电如下

----- -------------------------------------------------- -----------------------------------------




------------------------------------------------------------------------------------------------
and my html "blackout" is as follow
------------------------------------------------------------------------------------------------

<div id="blackOut" style="display: none; position: absolute; background-color: black;
        filter: alpha(opacity=70); -moz-opacity: 0.7; opacity: 0.7; z-index: 999; top: 0px;
        left: 0px; height: 1%; width: 1%; height: 1%;">
        <table width="100%" height="100%">
            <tr>
                <td align="center" valign="middle">
                    <h2 style="color: White; font-weight: bold">
                        Please wait...</h2>
                    <br />
                    <img src="/images/progress2.gif" />
                </td>
            </tr>
        </table>
    </div>









但问题不在于它没有锁定整个页面。

你可以帮我锁定整个页面,然后回发。





but the problem is than it do not lock the entire page.
can you please help me to lock entire page while post back.

推荐答案

使用Jquery Block UI插件



http://www.malsup.com/jquery/block/ [ ^ ]



或jQuery MSG插件



HT tp://dreamerslab.com/demos/jquery-blockui-alternative-with-jquery-msg-plugin [ ^ ]
Use Jquery Block UI plugin

http://www.malsup.com/jquery/block/[^]

Or jQuery MSG Plugin

http://dreamerslab.com/demos/jquery-blockui-alternative-with-jquery-msg-plugin[^]


这篇关于在javascript中回发期间锁定内容页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆