How to implement the dynamic switching effect of Baidu login box
How to achieve the dynamic switching effect of Baidu login box? This article mainly introduces jQuery to realize the dynamic switching effect of Baidu login box. Friends who need it can refer to it. I hope it can help everyone.
Click the picture in the lower right corner to switch the status, the effect picture
##
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>百度登录框</title> <style type="text/css"> *{margin: 0;padding: 0;} body { font-size: 12px; } a { text-decoration: none; color: #2647CB; } a:hover { text-decoration: underline; color: red; } .wrap { width: 390px; height: 450px; margin: 50px auto; border: 1px solid #8A8989; position: relative; } .main { width: 350px; height: 400px; margin: 0 auto; } .header { width: 100%; height: 50px; line-height: 50px; background-image: url(images/foot.png); background-color: rgb(247,247,247); background-repeat: no-repeat; } .header h3 { display: inline-block; line-height: 50px; margin-left: 50px; } .header span { display: inline-block; float: right; margin: auto 15px; font-size: 30px; } .inputp { display: block; width: 350px; height: 40px; margin: 10px auto; } .phoneIn { display: inline-block; float: right; font-size: 14px; background-image: url(images/phone.png); background-repeat: no-repeat; padding-left: 20px; margin: 30px 0px 10px 0px; } .smBtn { background: #2066C5; color: white; font-size: 18px; font-weight: bold; height: 50px; border-radius: 4px; } .smBtn:hover { background: #4067EE; } .pull-right { display: inline-block; float: right; } .other { width: 350px; padding-top: 50px; margin: 0 auto; } .togglep1,.togglep2 { position: absolute; right: 0; bottom: 0; z-index: 1000; } .weima { text-align: center; padding-top: 50px; width: 390px; height: 400px; } .weima p { line-height: 50px; } .choice2 { display: none; } #close:hover { cursor: pointer; color: blue; } </style> </head> <body> <!-- 账号密码登录 --> <p class="wrap"> <p class="header"> <h3 id="登录百度账号">登录百度账号</h3> <span id="close" title="关闭">X</span> </p> <p class="choice1"> <p class="main"> <a href="" class=" rel="external nofollow" rel="external nofollow" rel="external nofollow" phoneIn">短信快捷登录</a> <form action=""> <input type="text" class="inputp" placeholder="手机/邮箱/账号"> <input type="password" class="inputp" placeholder="请输入登录密码"> <p class="inputp"> <input type="checkbox" value="checked" checked="checked"><label for="">下次自动登录</label> <a href="" class=" rel="external nofollow" rel="external nofollow" rel="external nofollow" pull-right" >登录遇到问题</a> </p> <input type="submit" value="登录" class="inputp smBtn"> <a href="" class=" rel="external nofollow" rel="external nofollow" rel="external nofollow" pull-right" >立即注册</a> </form> <p class="other"> <p>可以使用以下方式登录</p> <a href=""><img src="/static/imghwm/default1.png" data-src=" rel=" class="lazy" external nofollow" rel="external nofollow" images/qq.png" alt=""></a> <a href=""><img src="/static/imghwm/default1.png" data-src=" rel=" class="lazy" external nofollow" rel="external nofollow" images/wb.png" alt=""></a> </p> </p> <p class="togglep1"> <img src="/static/imghwm/default1.png" data-src="images/small2wm.png" class="lazy" alt=""> </p> </p> <!-- 二维码登录 --> <p class="choice2"> <p class="weima"> <p>手机扫描,安全登录</p> <img src="/static/imghwm/default1.png" data-src="images/2weima.png" class="lazy" alt=""> <p>请使用手机百度app扫描登录</p> </p> <p class="togglep2"> <img src="/static/imghwm/default1.png" data-src="images/cpt.png" class="lazy" alt=""> </p> </p> </p> </body> <!-- 导入jquery文件 --> <script type="text/javascript" src="jquery-3.1.1.min.js"></script> <script> $(document).ready(function(){ /*这是一个自定义的函数,作用是设置class1类为隐藏,class2类显示*/ function showp(class1,class2){ $(class1).css("display","none"); $(class2).css("display","block"); } /*给右下角的图标设置点击事件*/ $('.togglep1').click(function(){ showp(".choice1",".choice2"); }) $('.togglep2').click(function(){ showp(".choice2",".choice1"); }) /*给右上角的关闭按钮设置点击事件*/ $("#close").click(function(){ $(".wrap").css("display","none"); }) }) </script> </html>Related recommendations:
How to make a Baidu login frame
Native js realizes the draggable login box effect
How to make a beautiful login box with CSS3_html/css_WEB-ITnose
The above is the detailed content of How to implement the dynamic switching effect of Baidu login box. For more information, please follow other related articles on the PHP Chinese website!

JavaScript is widely used in websites, mobile applications, desktop applications and server-side programming. 1) In website development, JavaScript operates DOM together with HTML and CSS to achieve dynamic effects and supports frameworks such as jQuery and React. 2) Through ReactNative and Ionic, JavaScript is used to develop cross-platform mobile applications. 3) The Electron framework enables JavaScript to build desktop applications. 4) Node.js allows JavaScript to run on the server side and supports high concurrent requests.

Python is more suitable for data science and automation, while JavaScript is more suitable for front-end and full-stack development. 1. Python performs well in data science and machine learning, using libraries such as NumPy and Pandas for data processing and modeling. 2. Python is concise and efficient in automation and scripting. 3. JavaScript is indispensable in front-end development and is used to build dynamic web pages and single-page applications. 4. JavaScript plays a role in back-end development through Node.js and supports full-stack development.

C and C play a vital role in the JavaScript engine, mainly used to implement interpreters and JIT compilers. 1) C is used to parse JavaScript source code and generate an abstract syntax tree. 2) C is responsible for generating and executing bytecode. 3) C implements the JIT compiler, optimizes and compiles hot-spot code at runtime, and significantly improves the execution efficiency of JavaScript.

JavaScript's application in the real world includes front-end and back-end development. 1) Display front-end applications by building a TODO list application, involving DOM operations and event processing. 2) Build RESTfulAPI through Node.js and Express to demonstrate back-end applications.

The main uses of JavaScript in web development include client interaction, form verification and asynchronous communication. 1) Dynamic content update and user interaction through DOM operations; 2) Client verification is carried out before the user submits data to improve the user experience; 3) Refreshless communication with the server is achieved through AJAX technology.

Understanding how JavaScript engine works internally is important to developers because it helps write more efficient code and understand performance bottlenecks and optimization strategies. 1) The engine's workflow includes three stages: parsing, compiling and execution; 2) During the execution process, the engine will perform dynamic optimization, such as inline cache and hidden classes; 3) Best practices include avoiding global variables, optimizing loops, using const and lets, and avoiding excessive use of closures.

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools