Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use jquery+CSS to realize floating login box mask

2025-04-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use jquery+CSS to achieve floating login box mask related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this article on how to use jquery+CSS to achieve floating login box mask, let's take a look.

Put the effect picture first, the shadow part cannot be clicked.

HTML code

User name

Secret code

Verification code

Log in

Logging in means you agree.

User Agreement

Privacy Policy

And

China Mobile Certification Service Agreement

Css code

/ * translucent mask layer * /

.shadow {

Background: # 000

Filter: alpha (opacity=70); / * transparency of IE * /

Opacity: 0.5; / * Transparency * /

Display: none

Position: absolute

Top: 0

Left: 0

Width: 100%

Height: 100%

Z-index: 965; / * the layer here is larger than the page * /

}

. login-box {

Text-align: center

Width: 500px

Height: 350px

Border-radius: 10px

/ * border: 3px solid gainsboro;*/

Position: absolute

Left: 50%

Top: 50%

Transform: translate (- 50%,-50%)

Background: # ffe3e1

-webkit-box-shadow: # 66600 6px

-moz-box-shadow: # 66600 6px

Box-shadow: # fff8e7 0 0 6px 6px

Z-index: 996; / * the layer here is larger than the mask layer * /

}

JQuery code

/ / Log in, click Login to display the login box

$("# login-link") .click (function () {

("# login-box") .show ()

("# shadow") .show ()

});

/ / close the login box and click the close button to close.

$("# close-login-btn") .click (function () {

("# login-box") .hide ()

("# shadow") .hide ()

});

This is the end of the article on "how to use jquery+CSS to achieve floating login box mask". Thank you for reading! I believe that everyone has a certain understanding of "how to use jquery+CSS to achieve floating login frame mask" knowledge, if you want to learn more knowledge, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report