HTML
<input type="button" value="-" class="jian">
<span class="num"><?=$list['g_num']?></span>
<input type="button" value="+" class="add">
JQUERY
<script>
//加的效果
$(".add").click(function(){
var n=$(this).prev().html();
var num=parseInt(n)+1;
if(num==0){ return;}
$(this).prev().html(num);
});
//减的效果
$(".jian").click(function(){
var n=$(this).next().html();
var num=parseInt(n)-1;
if(num==0){ return}
$(this).next().html(num);
});
</script>