Java JavaScript implements mask layer dynamic loading

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.