我想在用户提交表单时在屏幕上显示模式窗口。 我想禁用的形式(表现出一定加载图标)来显示该按钮被点击并正在处理动作,因为有时候在移动它不是我们的用户很清楚onsubmit()会触发,但不会更改手机上的元素样式
在PC浏览器(Firefox,IE,Opera)的一切工作正常,但在提交表单后,Android或WP 8.1 div覆盖层不显示。
你知道如何解决这个问题吗? 也许还有其他一些方法?
我的示例代码:
<script type="text/javascript">
function ShowLoadingPanel() {
document.getElementById('loadingPanel').style.display = 'block';
document.getElementById('overlay').style.display = 'block'
}
</script>
<body>
<div id="loadingPanel" class="loadingPanelStyle"></div>
<div id="overlay" class="blackOverlay"> </div>
<form id="form1" runat="server" onsubmit="return ShowLoadingPanel();">
//some content
<asp:Button runat="server" ID="xNext" Text="Next" OnClick="xNext_Click" />
</form>
</body>
而一些CSS模态窗口
.loadingPanelStyle
{
display: none;
position: fixed;
background:url(../img/load2.gif) no-repeat center center;
top: 25%;
left: 25%;
width: 50%;
height: 50%;
font-size: small;
z-index: 1002;
overflow: auto;
}
.blackOverlay
{
display: none;
position: fixed;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index: 1001;
-moz-opacity: 0.8;
opacity: .80;
filter: alpha(opacity=80);
}
您在第3行有错字,在“阻止”之前缺少“'” –
感谢您的注意,但这只是我的问题中的错字。当您在移动设备上提交时, – GigaKatowice
是否会重新加载页面? –