国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > HTML5 > 正文

分享一個H5原生form表單的checkbox特效代碼

2024-09-05 07:19:29
字體:
來源:轉載
供稿:網友

本文介紹了分享一個H5原生form表單的checkbox特效代碼,分享給大家,具體如下:

效果如下:

<!DOCTYPE html><html> <head>  <meta charset="UTF-8">  <title></title>  <style>   .md-checkbox {    margin: 50px;    position: relative;    height: auto;    font-size: 14px;   }   .md-checkbox label>span.inc {    -webkit-animation: growCircle 0.2s ease;    -moz-animation: growCircle 0.2s ease;    animation: growCircle 0.2s ease;   }      @keyframes growCircle {    0%,    100% {     transform: scale(0);     opacity: 0.8;    }    70% {     background: #eee;     transform: scale(1.25);    }   }      .md-checkbox label>span.inc {    background: #fff;    left: -20px;    top: -20px;    height: 60px;    width: 60px;    opacity: 0;    border-radius: 50% !important;    -moz-border-radius: 50% !important;    -webkit-border-radius: 50% !important;   }      .md-checkbox input[type=checkbox] {    visibility: hidden;    position: absolute;   }      .md-checkbox label {    cursor: pointer;    padding-left: 30px;   }      .md-checkbox label>span {    display: block;    position: absolute;    left: 0;    -webkit-transition-duration: 0.2s;    -moz-transition-duration: 0.2s;    transition-duration: 0.2s;   }      .md-checkbox label>.check {    top: -4px;    left: 6px;    width: 10px;    height: 20px;    border: 2px solid #26A69A;    border-top: none;    border-left: none;    opacity: 0;    z-index: 5;    -webkit-transform: rotate(180deg);    -moz-transform: rotate(180deg);    transform: rotate(180deg);    -webkit-transition-delay: 0.2s;    -moz-transition-delay: 0.2s;    transition-delay: 0.2s;   }      .md-checkbox input[type=checkbox]:checked~label>.check {    opacity: 1;    -webkit-transform: scale(1) rotate(45deg);    -moz-transform: scale(1) rotate(45deg);    transform: scale(1) rotate(45deg);   }      .md-checkbox input[type=checkbox]:checked~label>.box {    opacity: 0;    -webkit-transform: scale(0) rotate(-180deg);    -moz-transform: scale(0) rotate(-180deg);    transform: scale(0) rotate(-180deg);   }      .md-checkbox label>.box {    top: 0px;    border: 2px solid #666;    height: 20px;    width: 20px;    z-index: 5;    -webkit-transition-delay: 0.2s;    -moz-transition-delay: 0.2s;    transition-delay: 0.2s;   }  </style> </head> <body>  <div class="md-checkbox">   <input type="checkbox" id="test" class="md-check" />   <label for="test">    <span></span>             <span class="check"></span>             <span class="box"></span>                Option 1    </label>  </div>  <script>   var list = document.getElementsByTagName('input');   for(var i =0;i<list.length;i++){    (function(n){     list[n].addEventListener('click',function(e){      var inc = this.nextElementSibling.firstElementChild;      inc.className  = '';      setTimeout(function(){       inc.className  = 'inc';      },0);     })    })(i)   }  </script> </body></html>

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 祁东县| 长治县| 丹凤县| 苍梧县| 贡山| 泰顺县| 中超| 大兴区| 桃园县| 济源市| 沧州市| 平阴县| 鞍山市| 蓬安县| 竹北市| 陕西省| 观塘区| 永年县| 积石山| 晋州市| 麻阳| 黄大仙区| 苏尼特左旗| 洛川县| 乐至县| 淮滨县| 大城县| 慈利县| 图们市| 麦盖提县| 长兴县| 亳州市| 九龙县| 鲁甸县| 宁强县| 犍为县| 安溪县| 九寨沟县| 巨鹿县| 揭东县| 永康市|