In order to show an opaque background or animated gif while executing some method after an button click fails to show this. It only runs after all the code has been executed.
在“Qu”中,我可以这样做,即在一次点击事件上,在主要法典之前和之后使html发生变化。
长期运行的方法是,在网页上增加100-500分机,大约需要10秒钟。
$( #button).click(function() { $( #curtain ).css( visibility , visible ); longRunningMethod(); $( #curtain ).css( visibility , hidden ); });
The problem is that the #curtain div never shows, as the complete javascript has to be executed before rendering all the changes.
形式:
#curtain { position: fixed; _position: absolute; z-index: 99; left: 0; top: 0; width: 100%; height: 100%; _height: expression(document.body.offsetHeight + "px"); background-color: #CCCCCC; filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; visibility: hidden; }