ECSHOP商品详情页购买数量添加加减按钮

打开模板文件goods.dws 查找代码1<input name="number" type="text" id="number" value="1" size="4" onblur="changePrice()" style="border:1px solid #ccc; "/>修改为123<span class="goods_cut" onclick="goods_cut();changePrice();"><img src="images/plus1.gif" alt="减少" width="15" height="15" /></span><input name="number" type="text" id="number" value="1" size="4" onblur="changePrice()" style="border:1px solid #ccc; "/><span class="goods_add" onclick="goods_add();changePrice();"><img src="images/plus2.gif" alt="增加" width="15" height="15" /></span>再添加js脚本搜索以下代码1234567function changePrice(){var attr = getSelectedAttributes(document.forms['ECS_FORMBUY']);var qty = document.forms['ECS_FORMBUY'].elements['number'].value;Ajax.call('goods.php', 'act=price&id=' + goodsId + '&attr=' + attr + '&number=' + qty, changePriceResponse, 'GET', 'JSON');}在其下方添加以下代码123456789101112131415161718192021222324252627function goods_cut(){var num_val=document.getElementById('number');var new_num=num_val.value;var Num = parseInt(new_num);if(Num>1)Num=Num-1;num_val.value=Num;}function goods_add(){var num_val=document.getElementById('number');var new_num=num_val.value;var Num = parseInt(new_num);Num=Num+1;num_val.value=Num;}再添加CSS样式复制代码1234567891011121314151617181920212223242526272829303132333435363738394041424344454647/*--------------商品详情页增加减少-------------*/.goods_gds {height:35px;display:block;overflow:hidden;}.goods_font {display:block;float:left;height:15px;margin:8px 3px 0;font-size:12px;}.goods_cut {border:0 none;cursor:pointer;display:block;float:left;font-size:0;height:15px;line-height:0;margin:8px 3px 0;width:15px;padding-right:0px;_padding-right:0px;}input.goodsBuyBox,input.number {border:1px solid #DDDDDD;float:left;font-size:10px;height:18px;line-height:18px;margin:5px 5px 5px 5px;padding:0;text-align:center;}.goods_add {border:0 none;cursor:pointer;display:block;float:left;font-size:0;height:15px;line-height:0;margin:8px 3px 0;width:15px;}.goods_number_tit{display: block;background:none;text-align:left;padding-left:5px;}复制代码把下面的图片放进模板的图片文件夹,注意图片名称

(0)

相关推荐

    Database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1]

    select ID from ac_posts where ziID =  ;