日期:2014-05-16 浏览次数:20368 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<title>无标题文档</title>
<script type="text/javascript">
/*function addNum(){
var num = document.getElementById("buyNum").value;
if(num==""){
num = 0;
}else{
num = parseInt(num);
}
document.getElementById("buyNum").value = num + 1;
}
function reduceNum(){
var num = document.getElementById("buyNum").value;
var able=document.getElementById("reduce").visible;
if(num=="0"){
able.visible = false;
}else{
num = parseInt(num);
}
document.getElementById("buyNum").value = num - 1;
}*/
jQuery(function($){
$('span[rel=reduce]').click(function(){
//当前值
var currentInput=$(this).parents('div').find('input[rel=buyNum]');
if(currentInput.val() == "0"){
$(this).attr('disabled','true');
}else{