The method of implementing the mask layer in jquery

Source: Internet
Author: User
Tags html page

The examples in this article describe the way jquery implements masking layers. Share to everyone for your reference. as follows:

1. Suppose #main is the outermost div tag in the body of the page

2, the background is masked, the Display of pop-up window (default is not shown, the included CSS is not posted here):

?

1 2 3 4 5 6 7 8 9 10 11 <!--Status Bar Start--> <div id= "Warning-dialog" class= "status warning Center-top no-display" > <p class= " Closestatus "><a href=" javascript:$ () Hidewarningdialog () "title=" Close ">x</a></p> <div Class= "Clear" ></div> <p><span id= " Warning-dialog-detail ">Attention!</span></p> <div class=" closes "> <input type=" hidden "id=" Refresh-after-warning "value=" false "/> <input name=" "type=" image "Src=" images/niu_qd.jpg "align=" Absmiddle " class= "Button_jl" onclick= "javascript:$ () hidewarningdialog ()"/> </div> </div> <!--Status Bar End- ->

3, in script.js to define mask functions and pop-up operation functions, of course, script.js,jquery.js need to be included in the HTML page:

?

In this case, the main tag is used to get the height, width, and if you don't want the page height and width through the label, you can get

?

1 2 3 4 5 6 7 8 /* Current page height/function pageheight () {return document.body.scrollHeight}/* Current page width/function pagewidth () {return docum Ent.body.scrollWidth; }

4, call the Mask layer:

?

1 2 3 4 5 6 7 8 9 10 11 12 13-14 <script type= "Text/javascript" > Function init () {<?php if ($msg!= "User name input Error") {?> $.fn.showwarningdialog ("&L t;? PHP echo $msg;?> ", false"); <?php}?>} window.onload = function () {init ();}; </script>

I hope this article will help you with your jquery programming.

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.