<strike id="3tkic"><sup id="3tkic"></sup></strike>

  1. <ul id="3tkic"></ul>
      <b id="3tkic"><legend id="3tkic"></legend></b>
      <b id="3tkic"><meter id="3tkic"></meter></b>

    • <strike id="3tkic"></strike>

      <blockquote id="3tkic"></blockquote>

    • 亚洲AV无码国产在丝袜线观看_亚洲第一页A∨在线_亚洲国产人成在线观看69网站_无码日韩人妻AV一区免费l

      css3實現(xiàn)的switch開關(guān)效果

      2016/9/3 8:46:27   閱讀:1562    發(fā)布者:1562

      之前阿里電面的時候問的一個問題,今天抽時間做了個demo。

      html結(jié)構(gòu)

          <div class="container"> 
              <div class="bg_con"> 
                  <input id="checked_1" type="checkbox" class="switch" /> 
                  <label for="checked_1"></label> 
              </div> 
          </div>

      css代碼,:before負責顏色,:after是那個白色小圓點,切換時的過渡效果用css3的動畫實現(xiàn)。 

      .switch{ 
              display:none; 
          } 
          label{ 
              position:relative; 
              display: block; 
              padding: 1px; 
              border-radius: 24px; 
              height: 22px; 
              margin-bottom: 15px; 
              background-color: #eee; 
              cursor: pointer; 
              vertical-align: top; 
              -webkit-user-select: none; 
          } 
          label:before{ 
              content: ’’; 
              display: block; 
              border-radius: 24px; 
              height: 22px; 
              background-color: white; 
              -webkit-transform: scale(1, 1); 
              -webkit-transition: all 0.3s ease; 
          } 
          label:after{ 
              content: ’’; 
              position: absolute; 
              top: 50%;   
              left: 50%;   
              margin-top: -11px;   
              margin-left: -11px; 
              width: 22px; 
              height: 22px; 
              border-radius: 22px; 
              background-color: white; 
              box-shadow: 1px 1px 1px 1px rgba(0,0,0,0.08); 
              -webkit-transform: translateX(-9px); 
              -webkit-transition: all 0.3s ease; 
          } 
          .switch:checked~label:after{ 
              -webkit-transform: translateX(9px); 
          } 
           
          .switch:checked~label:before{ 
              background-color:green; 
          }  

       

      亚洲AV无码国产在丝袜线观看_亚洲第一页A∨在线_亚洲国产人成在线观看69网站_无码日韩人妻AV一区免费l
      <strike id="3tkic"><sup id="3tkic"></sup></strike>

      1. <ul id="3tkic"></ul>
          <b id="3tkic"><legend id="3tkic"></legend></b>
          <b id="3tkic"><meter id="3tkic"></meter></b>

        • <strike id="3tkic"></strike>

          <blockquote id="3tkic"></blockquote>

        • 历史| 伊宁县| 突泉县| 万年县| 蓬安县| 汝州市| 佛山市| 新巴尔虎右旗| 江源县| 喀喇沁旗| 屏山县| 兴化市| 紫阳县| 兰坪| 湖北省| 南华县| 宁明县| 遂昌县| 新河县| 读书| 安庆市| 贵港市| 九寨沟县| 贵州省| 吴忠市| 甘泉县| 红原县| 南岸区| 扎囊县| 射洪县| 株洲县| 辽中县| 大丰市| 香格里拉县| 罗山县| 绍兴县| 凤翔县| 班戈县| 临西县| 巨野县| 安顺市|