支付密码的效果

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			*{
				margin:0;
				padding:0;
			}
			.goodsCode h1{
				font-size: 30px;
				font-weight: 400;
				text-align: center;
				color: #fff;
				margin-bottom:30px;
			}
			.goodsCode{
				padding-top:40px;
				width:100%;
				height:220px;
				background: #586897;
				text-align: center;
			}
			.goodsCode input{
				margin: 0;
			    padding: 0;
			    width: 1px;
			    opacity: 0;
			    height: 1px;
			    border: none;
			}
			.goodsCode label{
				display: block;
			}
			.goodsCode ul{
				background:#586897;
			    display: inline-block;
			    position: relative;
			}
			.goodsCode ul li{
				display: inline-block;
			    width: 60px;
			    height: 80px;
			    background:#fff;
			    font-size: 40px;
			    font-weight: 700;
			    text-align: center;
			    line-height: 80px;
			    margin-right:10px;
			    vertical-align: middle;
			    overflow: hidden;
			    color:#586897;
			}
		</style>
	</head>
	<body>
		<div class="goodsCode">
			<h1>支付密码效果</h1>
			<label for="ipt">
				<ul>
					<li></li>
					<li></li>
					<li></li>
					<li></li>
					<li></li>
					<li></li>
				</ul>
			</label>
			<input type="tel" id="ipt" maxlength="6">
		</div>
		
		<script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
		<script>
			$('.goodsCode input').on('input', function (e){
				var numLen = 6;
				var pw = $('.goodsCode input').val();
				var list = $('li');
				for(var i=0; i<numLen; i++){
					if(pw[i]){
						$(list[i]).text(pw[i]);
					}else{
						$(list[i]).text('');
					}
				}
			});
		</script>
	</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值