Js simulates the code of the pop-up window for Baidu user login

Source: Internet
Author: User
Tags visibility
Tip: you can modify some code before running

Js simulates the code of the pop-up window for Baidu user login<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><script language="javascript">Var popup_dragging = false; var popup_target; var popup_mouseX; var popup_mouseY; var popup_mouseposX; var callback; var popup_oldfunction; function popup_display (x) {var win = window. open (); for (var I in x) win.doc ument. write (I + '=' + x [I] +'<br>');} // ----- Popup_mousedown callback function popup_mousedown (e) {var ie = navigator. appName = "Microsoft Internet Explorer"; if (ie & window. event. button! = 1) return; if (! Ie & e. button! = 0) return; popup_dragging = true; popup_target = this ['target']; popup_mouseX = ie? Window. event. clientX: e. clientX; popup_mouseY = ie? Window. event. clientY: e. clientY; if (ie) popup_oldfunction = document. onselectstart; else popup_oldfunction = document. onmousedown; if (ie) document. onselectstart = new Function ("return false;"); else document. onmousedown = new Function ("return false;") ;}// ----- popup_mousemove ------------------------------------------------------- function popup_mousemove (e) {if (! Popup_dragging) return; var ie = navigator. appName = "Microsoft Internet Explorer"; var element = document. getElementById (popup_target); var mouseX = ie? Window. event. clientX: e. clientX; var mouseY = ie? Window. event. clientY: e. clientY; element. style. left = (element. offsetLeft + mouseX-popup_mouseX) + 'px '; element. style. top = (element. offsetTop + mouseY-popup_mouseY) + 'px '; popup_mouseX = ie? Window. event. clientX: e. clientX; popup_mouseY = ie? Window. event. clientY: e. clientY;} // ----- popup_mouseup ------------------------------------------------------- function popup_mouseup (e) {if (! Popup_dragging) return; popup_dragging = false; var ie = navigator. appName = "Microsoft Internet Explorer"; var element = document. getElementById (popup_target); if (ie) document. onselectstart = popup_oldfunction; else document. onmousedown = popup_oldfunction;} // ----- popup_exit ---------------------------------------------------------- function popup_exit (e) {var ie = navigator. appName = "Micro Soft Internet Explorer "; var element = document. getElementById (popup_target); popup_mouseup (e); element. style. visibility = 'hiden '; element. style. display = 'none';} // ----- popup_show -------------------------------------------------------------- function popup_show () {element = document. getElementById ('popup'); drag_element = document. getElementById ('popup _ drag'); exit_element = document. getElement ById ('popup _ exit '); element. style. position = "absolute"; element. style. visibility = "visible"; element. style. display = "block"; element. style. left = (document.doc umentElement. scrollLeft + popup_mouseposX-10) + 'px '; element. style. top = (document.doc umentElement. scrollTop + popup_mouseposY-10) + 'px '; drag_element ['target'] = 'popup'; drag_element.onmousedown = popup_mousedown; exit_element.onclick = popu P_exit;} // ----- popup_mousepos callback function popup_mousepos (e) {var ie = navigator. appName = "Microsoft Internet Explorer"; popup_mouseposX = ie? Window. event. clientX: e. clientX; popup_mouseposY = ie? Window. event. clientY: e. clientY;} // ----- Attach Events --------------------------------------------------------- if (navigator. appName = "Microsoft Internet Explorer") document. attachEvent ('onmousedown ', popup_mousepos); else document. addEventListener ('mousedown ', popup_mousepos, false); if (navigator. appName = "Microsoft Internet Explorer") document. attachEvent ('onmousemove ', popup_mousemove); else document. addEventListener ('mousemove ', popup_mousemove, false); if (navigator. appName = "Microsoft Internet Explorer") document. attachEvent ('onmouseup', popup_mouseup); else document. addEventListener ('mouseup', popup_mouseup, false );</script> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>Click login to bring up the login box</title><style type="text/css">/*<style> */.login { z-index: +1; }body{ font-size:12px; font-family:Arial, Helvetica, sans-serif;}.login .inputb { width:97px; height:15px; border:1px solid #baced6; font-size:12px; padding-top:2px; margin-right:6px; display:block; float:left;}.login_header{cursor:move}.login div.login_header{ border: black; border-bottom: 0px; cursor: default; width: 254px; height: 31px; line-height: 19px; vertical-align: middle; background: url('images/headbg.GIF') no-repeat; text-decoration: none;}.login div.login_body{ border: black; width: 254px; background: url('images/login_bg.gif') no-repeat left bottom; margin:0;}.login img.login_exit{ float: right; margin: 6px 8px 0px 0px; cursor: pointer;}.login table{ border-collapse: collapse; margin-bottom:5px;}.login table th , .login table td { padding:3px 0;}.login table th { width:68px; text-align:right; font-weight:normal; color:#4e6aab; }.login .code {}.login .code img { border:1px solid #adc6dd; margin-bottom:-5px;}.login .lsubmit { padding-left:60px;}.login table td .linka { display:block; float:left; padding-top:4px; }</style></head><body>Quickly log on to the registration pass and forget the password?<div class="login" id="popup" ><div class="login_header" id="popup_drag"></div><div class="login_body"><form id="member_login" name="member_login" action="{$MOD[linkurl]}login.php" method="post"><table > <tr> <th>User name:</th> <td><input type="text" class="inputb" />Quick Registration</td> </tr> <tr> <th>Password:</th> <td><input type="text" class="inputb" />Forgot Password</td> </tr> <tr> <th>Verification code:</th> <td><input type="text" class="inputb" /> </td> </tr> <tr> <th>Cookie:</th> <td> <select name="select" id="select"> <option value="1">Keep for one year</option> </select> </td> </tr> <tr> <td colspan="2" class="lsubmit"><input type="submit" value="登 录" /> <input type="submit" value="重 置" /></td> </tr> </table></form></div></div></div></body></html>
Tip: you can modify some code before running

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.