JQuery makes a fancy navigation with a shaded background and highlighted mode window

  • 2020-03-30 02:38:20
  • OfStack

< img SRC = "border = 0 / / files.jb51.net/file_images/article/201404/201404151604171.gif? 201431516511 ">  
HTML link:
<a href="#" rel="registerwindow" class="model"> registered </a> 

img{ border:0px;} 
#registerwindow{ width:600px; height:400px; top:50px; right:100px; background:#FFF; display:none; border:5px #999 solid; position:absolute; z-index:999;} 
#modelshade{width:100%; height:100%; background:#000; display:none; position:absolute; top:0px; z-index:0;} 

One: create and invoke mode Windows
<div id="registerwindow"> 
<h1 align="center"> registered </h1><br> 
<div style="width:250px; margin:0 auto;"> 
 User name: <input type="text" name="username" size="20"><br> 
 The secret   Code: <input type="password" name="password" size="20"><br> 
<input type="submit" name="submit" value=" registered " > 

1. Create a jQuery statement that selects a trace tag with a class of schemas
<!--  registered model start--> 

2. Use the following function to store the variables in the current project as values of the rel attribute
var modelID = $(this).attr('rel'); 

3. Set the effect of the mode window and add the picture link to close the window
$('#'+modelID).fadeIn(2000).prepend('<a href="#" class="close"><img src="images/close.png" class="close_button" title="close window" alt="close"></a>'); 

Create a shaded background

Close the mode window
var thismodelID= $('a.close').parent().attr('id'); 
return false; 

Close the failed connection of the click function, this method will keep the connection and try to load another page into the browser
return false; 

<!--  registered model end--> 


Related articles: