溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

jQuery如何實(shí)現(xiàn)百度登錄框的動(dòng)態(tài)切換效果

發(fā)布時(shí)間:2021-06-24 14:59:11 來(lái)源:億速云 閱讀:151 作者:小新 欄目:web開(kāi)發(fā)

這篇文章主要介紹了jQuery如何實(shí)現(xiàn)百度登錄框的動(dòng)態(tài)切換效果,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

點(diǎn)擊右下角圖片進(jìn)行狀態(tài)切換,效果圖

jQuery如何實(shí)現(xiàn)百度登錄框的動(dòng)態(tài)切換效果

jQuery如何實(shí)現(xiàn)百度登錄框的動(dòng)態(tài)切換效果

<!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 h4 
    { 
      display: inline-block; 
      line-height: 50px; 
      margin-left: 50px; 
    } 
    .header span 
    { 
      display: inline-block; 
      float: right; 
      margin: auto 15px; 
      font-size: 30px; 
    } 
    .inputDiv 
    { 
      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; 
    } 
    .toggleDiv1,.toggleDiv2 
    { 
      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> 
<!-- 賬號(hào)密碼登錄 --> 
  <div class="wrap"> 
    <div class="header"> 
      <h4>登錄百度賬號(hào)</h4> 
      <span id="close" title="關(guān)閉">X</span> 
    </div> 
    <div class="choice1"> 
      <div class="main"> 
      <a href="" class=" rel="external nofollow" rel="external nofollow" rel="external nofollow" phoneIn">短信快捷登錄</a> 
      <form action=""> 
        <input type="text" class="inputDiv" placeholder="手機(jī)/郵箱/賬號(hào)"> 
        <input type="password" class="inputDiv" placeholder="請(qǐng)輸入登錄密碼"> 
        <p class="inputDiv"> 
        <input type="checkbox" value="checked" checked="checked"><label for="">下次自動(dòng)登錄</label> 
        <a href="" class=" rel="external nofollow" rel="external nofollow" rel="external nofollow" pull-right" >登錄遇到問(wèn)題</a> 
        </p> 
        <input type="submit" value="登錄" class="inputDiv smBtn"> 
        <a href="" class=" rel="external nofollow" rel="external nofollow" rel="external nofollow" pull-right" >立即注冊(cè)</a> 
      </form> 
      <div class="other"> 
      <p>可以使用以下方式登錄</p> 
      <a href=""><img src=" rel="external nofollow" rel="external nofollow" images/qq.png" ></a> 
      <a href=""><img src=" rel="external nofollow" rel="external nofollow" images/wb.png" ></a> 
      </div> 
    </div> 
    <div class="toggleDiv1"> 
      <img src="images/small2wm.png" > 
      </div> 
    </div> 
    <!-- 二維碼登錄 --> 
<div class="choice2"> 
    <div class="weima"> 
    <p>手機(jī)掃描,安全登錄</p> 
    <img src="images/2weima.png" > 
    <p>請(qǐng)使用手機(jī)百度app掃描登錄</p> 
  </div> 
    <div class="toggleDiv2"> 
      <img src="images/cpt.png" > 
    </div> 
  </div> 
  </div> 
</body> 
<!-- 導(dǎo)入jquery文件 --> 
<script type="text/javascript" src="jquery-3.1.1.min.js"></script> 
<script> 
  $(document).ready(function(){ 
  /*這是一個(gè)自定義的函數(shù),作用是設(shè)置class1類(lèi)為隱藏,class2類(lèi)顯示*/ 
     function showDiv(class1,class2){ 
      $(class1).css("display","none"); 
      $(class2).css("display","block"); 
     } 
  /*給右下角的圖標(biāo)設(shè)置點(diǎn)擊事件*/ 
    $('.toggleDiv1').click(function(){ 
      showDiv(".choice1",".choice2"); 
    }) 
    $('.toggleDiv2').click(function(){ 
      showDiv(".choice2",".choice1"); 
    }) 
  /*給右上角的關(guān)閉按鈕設(shè)置點(diǎn)擊事件*/ 
    $("#close").click(function(){ 
      $(".wrap").css("display","none"); 
    }) 
  }) 
</script> 
</html>

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“jQuery如何實(shí)現(xiàn)百度登錄框的動(dòng)態(tài)切換效果”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持億速云,關(guān)注億速云行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來(lái)學(xué)習(xí)!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI