You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
553 B
25 lines
553 B
//数量选择
|
|
function quantity(){
|
|
var quantity = Number($("#quantity").val());
|
|
var perNumber = Number($("#perNumber").val());
|
|
var perMinNumber = Number($("#perMinNumber").val());
|
|
|
|
$(".btn-reduce").click(function(){
|
|
if(quantity>perMinNumber){
|
|
quantity-=1;
|
|
$("#quantity").val(quantity);
|
|
}else{
|
|
$("#quantity").val(perMinNumber);
|
|
}
|
|
});
|
|
|
|
$(".btn-add").click(function(){
|
|
if(quantity<perNumber){
|
|
quantity+=1;
|
|
$("#quantity").val(quantity);
|
|
}else{
|
|
$("#quantity").val(perNumber);
|
|
}
|
|
})
|
|
}
|
|
quantity();
|