<div class="input"> <input type="tel" placeholder="随" maxlength=""><!- -><input type="tel" placeholder="机" maxlength=""><!- -><input type="tel" placeholder="" maxlength=""><!- -><input type="tel" placeholder="位" maxlength=""><!- -><input type="tel" placeholder="数" maxlength=""> </div>
input {
display: inline-block;
&:last-child {
border-right: px solid #;
}
input {
border-top: px solid #;
border-bottom: px solid #;
border-left: px solid #;
width: px;
height: px;
outline:none;
font-family: inherit;
font-size: px;
font-weight: inherit;
text-align: center;
line-height: px;
color: #ccc;
background: rgba(,,,);
}
}
/**
* 模拟支付宝的密码输入形式
*/
(function (window, document) {
var active = ,
inputBtn = document.querySelectorAll('input');
for (var i = ; i < inputBtn.length; i++) {
inputBtn[i].addEventListener('click', function () {
inputBtn[active].focus();
}, false);
inputBtn[i].addEventListener('focus', function () {
this.addEventListener('keyup', listenKeyUp, false);
}, false);
inputBtn[i].addEventListener('blur', function () {
this.removeEventListener('keyup', listenKeyUp, false);
}, false);
}
/**
* 监听键盘的敲击事件
*/
function listenKeyUp() {
var beginBtn = document.querySelector('#beginBtn');
if (!isNaN(this.value) && this.value.length != ) {
if (active < ) {
active += ;
}
inputBtn[active].focus();
} else if (this.value.length == ) {
if (active > ) {
active -= ;
}
inputBtn[active].focus();
}
if (active >= ) {
var _value = inputBtn[active].value;
if (beginBtn.className == 'begin-no' && !isNaN(_value) && _value.length != ) {
beginBtn.className = 'begin';
beginBtn.addEventListener('click', function () {
calculate.begin();
}, false);
}
} else {
if (beginBtn.className == 'begin') {
beginBtn.className = 'begin-no';
}
}
}
})(window, document);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有