jquery实现动感增减加减数量选择框效果代码

代码语言:html

所属分类:表单美化

代码描述:jquery实现动感增减加减数量选择框效果代码

代码标签: jquery 加减 增减 数量 输入框

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">

    <link href="https://fonts.googleapis.com/css?family=Passion+One" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Neucha" rel="stylesheet">
    <style>
        * {
    	margin:0;
    	padding:0
    }
    body {
    	text-align:center;
    	font-family:'Passion One',cursive;
    	background:#ccc
    }
    .wrapper {
    	margin:80px auto;
    	width:100%;
    	max-width:120px;
    	border-radius:5px;
    	background:#fff;
    	box-shadow:rgba(0,0,0,0.1) 0 0 25px;
    	position:relative
    }
    .wrapper h3,.wrapper p {
    	font-family:'Neucha',cursive;
    	padding:10px;
    	border-radius:5px 0 0 5px;
    	font-size:18px;
    	color:#333
    }
    .wrapper p {
    	color:#666;
    	font-size:16px
    }
    .number-wrap {
    	height:50px;
    	font-size:48px;
    	width:100%;
    	position:relative;
    	overflow:hidden;
    	text-align:center;
    	display:inline-block;
    	padding:10px 0;
    	background:#eaeaea
    }
    .digit {
    	width:100%;
    	position:absolute;
    	left:0;
    	top:10px;
    	-webkit-transition:all .2s ease;
    	-moz-transition:all .2s ease;
    	-o-transition:all .2s ease;
    	-ms-transition:all .2s ease;
    	transition:all .2s ease
    }
    .digit span {
    	display:block
    }
    .button {
    	display:inline-block;
    	padding:5px;
    	background:#fff;
    	border-radius:50%;
    	width:40px;
    	height:40px;
    	font-size:26px;
    	-webkit-box-sizing:border-box;
    	-moz-box-sizing:border-box;
    	box-sizing:border-box;
    	position:absolute;
    	top:50%;
    	margin-top:-20px;
    	box-shadow:rgba(0,0,0,0.1) 0 0 8px;
    	cursor:pointer;
    	-webkit-transition:-webkit-transform .3s cubic-bezier(0,.99,.44,1.4);
    	-moz-transition:-moz-transform .3s cubic-bezier(0,.99,.44,1.4);
    	-o-transition:-o-transform .3s cubic-bezier(0,.99,.44,1.4);
    	-ms-transition:-ms-transform .3s cubic-bezier(0,.99,.44,1.4);
    	transition:transform .3s cubic-bezier(0,.99,.44,1.4);
    	-webkit-touch-callout:none;
    	-webkit-user-select:none;
    	-khtml-user-select:none;
    	-moz-user-select:none;
    	-ms-user-select:none;
    	user-select:none
    }
    .plus {
    	right:-20px;
    	color:#538ae4
    }
    .minus {
    	left:-20px;
    	color:#e4535a
    }
    .disabled {
    	color:#ccc
    }
    .button:hover {
    	-moz-transform:scale(1.2);
    	-webkit-transform:scale(1.2);
    	-o-transform:scale(1.2);
    	-ms-transform:scale(1.2);
    	transform:scale(1.2)
    }
    .button:active {
    	-moz-transform:scale(1);
    	-webkit-transform:scale(1);
    	-o-transform:scale(1);
    	-ms-transform:scale(1);
    	transform:scale(1)
    }
    </style>
</head>

<body>
    <!-- partial:index.partial.html -->
    <div class="wrapper">
        <h3>Quantity</h3>
        <div class="number-wrap"><span class="digit"><span></span></span>
        </div>
        <div class="button plus" id="plus">+</div>
        <div class="button minus disabled" id="minus">-</div>
        <p>$<span></span>.00</p>
    </div>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/.........完整代码请登录后点击上方下载按钮下载查看

网友评论0