Through Java, JavaScript and CSS to achieve a gray mask layer after the Click button, and display the word dynamically loaded, improve the user experience, nonsense said, on the code (the reason for this blog is the online code too many novice don't know where to go, here to remove all irrelevant code, Displays only the minimum code that can appear in the feature.
First: For
Second: The code that implements the above effect is
1: Masking layer CSS Code
<style type= "Text/css" >
#load {position:fixed; top:0px; right:0px; Bottom:0px;filter:alpha (opacity=60); Background-color: #777;
z-index:1002; left:0px; Display:none;
opacity:0.5; -moz-opacity:0.5;padding-top:100px;color: #000000}
</style>
2: Load in div
<div id= "Load" align= "center" > Loading in ...</div>
3: button that triggers the matte effect
<input id= "btnsubmit" name= "btnsubmit" type= "button" value= "Load" onclick= "Updateresult ();"/>
4: Interface initialization js, so that mask layer effect is hidden when loading the interface
$ (document). Ready (function () {
$ (' #load '). Hide ();
});
5: Click the Load button, trigger mask layer effect display, load data finish in Exit effect
$ (' #load '). FadeIn ();
$ (' #load '). FadeOut ();
Finally attach the Loading.gif diagram to achieve the effect, if necessary to download the use:
Java JavaScript implements mask layer dynamic loading