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.