A simple popup centering effect on the mobile side

Source: Internet
Author: User

1<! DOCTYPE html>234<title></title>5<style type="Text/css">6 #mask_box {7Width -%;8Height -%;9Z-index:9999;TenPositionfixed; OneTop0; ALeft0; - Display:none; -         } the #DialogWrapper { - width:500px; - margin:50px Auto; - padding:10px; +text-Align:center; - background: #f1f1f1; +border-radius:20px; A         } at #DialogYesBtn { -margin-left:10px; - color: #fff; - padding:5px 20px; - Cursor:pointer; -         } in #DialogNoBtn { - padding:5px 10px; to Cursor:pointer; +         } - #DialogWrapper img { theWidth -%; *         } $@media screen and (max-width:768px) {Panax Notoginseng             /*CSS for mobile*/ -         } the</style> + A<body> the<div id="Mask_box"> +<div id="Dialogwrapper"> -<divclass="dialog_content"> $&LT;H1 style="font-size:40px;border-bottom:1px solid #ddd;p adding-bottom:10px;">Viavelobike $<div> -<p>please Choose your country:</p> -</div> the<divclass="Dialog_text"> -"dialogyesbtn"Src="https://cdn.shopify.com/s/files/1/1811/7921/t/4/assets/canada.jpg"alt="Canada"/>Wuyi"dialognobtn"Src="https://cdn.shopify.com/s/files/1/1811/7921/t/4/assets/us.jpg"alt="US"/> the</div> -</div> Wu</div> -</div> About</body> $<script src="Jquery-1.12.4.min.js"></script> -<script> - $ (function () { -$("#mask_box"). Fadetoggle ( +); A  +    }); the $ (function () { -$("#DialogYesBtn"). Click (function () { $Window.location.href ='http://stackoverflow.com/';//Special for the programmer's question and answer site, seconds to kill a certain degree of domestic the        }) the$("#DialogNoBtn"). Click (function () { the$("#mask_box"). Fadetoggle ( -); the        }) -    }); in</script> the

Code parsing: First, only applicable to the need to pop-up window and center effect, but the above code does not apply to a translucent matte effect of the scene, if you want to achieve, with the help of JS, and then Add.

A simple popup centering effect on the mobile side

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.