2015.3.12 (masking layer JS module)

Source: Internet
Author: User

Having learned about some of the tools and libraries and frameworks that are commonly used in front-end development, there is a question of whether using these out-of-the-box frameworks will lead to a lot of overkill. Is that every page will have to load the framework and libraries that may be used, but in fact, the implementation of this page will only use a small part, which will virtually slow down or cause users to waste of traffic.  How to solve this problem? No development experience Ah, this optimization problem is a little confused.

Today's practice requires a masking layer that can be used to click on images to enlarge images and to replace the alert that comes with the system, and writes the following JS module. Easy to invoke directly in the project.

The following is the code for the HTML section. Only the JS module is called in the OnClick event of the button;

The following is the code of the JS module, set up three mask layer, the bottom bottomdiv is a screen with the Gao Tongkuan full transparent mask layer, the middle of the middlediv is a shadow, and the top of the visual newdiv size is basically the same, just slightly below the positioning, Can achieve a shadow effect.

The color is very ugly ... The decision here is to replace the button with a-a tag, and use the a:hover to simulate the effect of the buttons slightly better than the one that comes with it.

The day arch is a stroke, the time is quick.

2015.3.12 (masking layer JS module)

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.