<div class="codetitle"> <span><a style="CURSOR: pointer" data="48884" class="copybut" id="copybut48884" onclick="doCopy('code48884')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code48884"> <br> <br> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <br><title>js登录弹出层 登录框特效</title> <br><script type="text/javascript" src="/ajaxjs/jquery-1.6.2.min.js"></script> <br><script type="text/javascript" src="/jscss/demoimg/201310/thickbox_plus.js"></script> <br><style> <BR>body{background-color: #fff;} <BR>html, body{height: 100%;} <BR>html body{font: 12px Arial, Helvetica, sans-serif;color: #333333} <BR>html>body{font: 12px Arial, Helvetica, sans-serif;color: #333333} <BR>#TB_overlay{position: absolute;top: 0;left: 0;z-index: 100;width: 100%;height: 100%;background-color: #CCC;filter: alpha(opacity=60);-moz-opacity: 0.6;opacity: 0.6;} <BR>#TB_window{top: 0px;left: 0px;position: fixed;_position: absolute;background: #fff;z-index: 102;color: #000000;display: none;border: 5px solid #666;} <BR>#TB_caption{height: 25px;padding: 10px 30px 10px 25px;} <BR>#TB_closeWindow{height: 25px;padding: 10px 25px 10px 0;float: right;} <BR>#TB_closeAjaxWindow{padding: 5px 10px 7px 0;margin-bottom: 1px;text-align: right;background-color: #e8e8e8;} <BR>#TB_ajaxContent{padding: 2px 15px 15px 15px;overflow: auto;} <BR>#TB_load{text-align: center;position: absolute;top: 50%;left: 0px;width: 100%;overflow: visible;visibility: visible;display: block;z-index: 101;} <BR>#TB_loadContent{margin-left: -125px;position: absolute;top: -50px;left: 50%;width: 250px;height: 100px;visibility: visible;} <BR></style> <br> <br> <br><a href="/jscss/demoimg/201310/ShowLogin.html?height=160;width=400" title="登录后方可进行操作" class="thickbox">马上登录</a> <br> <br> <br> </div> <br>JavaScript点击弹出层,点击后弹出一个登录层,jQuery版本1.6.2,在这个层内的内容调用了一个示例页面,原理基于thickbox_plus.js,thickbox大多被用于显示放大图片,用在这里也挺新颖哦,请注意文件路径,所需要的js文件一般在jscss/demoimg/201310目录下,图片可在页面上点击右键另存为。