这个一般用JS来实现,大致应该是这样
function del(){
var count = document.getElementById("count").value;
count--;
document.getElementById("count").value = count ;
if(count<=1){
document.getElementById("del0").style.display = block;
document.getElementById("del1").style.display = none;
}
if(count < total){//假定total是库存量
document.getElementById("add0").style.display = block;
document.getElementById("add1").style.display = none;
}
}
function add(){
//......和del方法类似
}
src="...." onclick="del()" style="dispaly:block">
src="...." style="display:none">
1
src="...." onclick="add()" style="dispaly:block">
src="...." style="dispaly:none">
很久没写代码了,估计疏漏不少,不过大致是这样的思路