国产探花免费观看_亚洲丰满少妇自慰呻吟_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>

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 德兴市| 盐亭县| 兴和县| 甘谷县| 孝感市| 二连浩特市| 马山县| 无锡市| 巴塘县| 德惠市| 河南省| 佛山市| 水城县| 阳江市| 宣汉县| 祁连县| 什邡市| 福贡县| 定边县| 南岸区| 安平县| 克什克腾旗| 高青县| 嘉义市| 孝感市| 岗巴县| 桦甸市| 通化县| 全椒县| 五台县| 南京市| 乐山市| 大同县| 吴旗县| 太保市| 息烽县| 突泉县| 亳州市| 连南| 永城市| 黄大仙区|