<noframes id="3fdf1">

      <pre id="3fdf1"></pre>
        <ruby id="3fdf1"></ruby>
        <track id="3fdf1"><strike id="3fdf1"><rp id="3fdf1"></rp></strike></track>
        <pre id="3fdf1"></pre>
        <pre id="3fdf1"><ruby id="3fdf1"></ruby></pre>

        <ruby id="3fdf1"><strike id="3fdf1"><var id="3fdf1"></var></strike></ruby>

        建站知識

        Welcome to Beijing RuiHeng TianLong Technology Co., Ltd.

        ecshop購買數量的加減按鈕,加一個減一個代碼,商品數量加減代碼

        時間:  來源:網站建設公司  作者:網站制作公司  點擊量:
        ecshop購買數量的加減按鈕,加一個減一個代碼,商品數量加減代碼

        方法一:

        1.復制以下JS代碼,添加到 js/common.js 的最后


        function cart_number(txt_id, type, num)
            num = num || 1;   
         var txt = document.getElementByIdx_x_x(txt_id);    
        var source_num = parseInt(txt.value);   
         if (source_num == 1 && type == '-')   
           
         alert('請最少購買一個商品');  
               return;   
           
         var to_num       = source_num;    
        if (type == '+')   
               
         to_num += num;   
            
        else if (type == '-')   
             
           to_num -= num; 
             
          txt.value = to_num;  
          showdiv(txt);
         }
         

         

         

        2.在flow.dwt中找到購買數量的文本框,在他的前后分別加上

        <a href="javascript:cart_number('goods_number_{$goods.rec_id}', '-');">-</a>
        <a href="javascript:cart_number('goods_number_{$goods.rec_id}', '+');">+</a>

         

         方法二:

        在flow.dwt中找到購買數量的文本框,在他的前后分別加上

        <IMG style="PADDING-LEFT: 0px; CURSOR: pointer"
        onclick='if (document.getElementByIdx_x("number").value>1){document.getElementByIdx_x("number").value--;}'
        src="images/down.gif" >&nbsp;

         <INPUT id=number style="WIDTH: 40px; TEXT-ALIGN: right" maxLength=4
        value=1 name=cart_quantity> 


        &nbsp;<IMG style="PADDING-RIGHT: 30px; MARGIN: 0px; WIDTH: 25px; CURSOR: pointer" onclick='document.getElementByIdx_x("number").value++;'
        src="images/up.gif" >

        本文TAG標簽: 商城網站建設 商城網站制作 做網上商城
        返回關閉本頁
        上一篇:網站建設避免的幾大誤區    下一篇:ppt幻燈片原尺寸播放,不全屏播放,原大小播放
        推薦閱讀

        Copyright © 2010-2021 北京瑞恒天龍科技有限公司  All Rights Reserved  |  北京網站建設知名服務商  |  北京網站制作 | 京ICP備11004170號-1   京公網安備110107000463號
        地址:北京市海淀區永定路長銀大廈B座  非工作時間:15810379666  服務熱線:010-89941606 座機:010-89941606 轉801/802/803/804  版權所有 盜版必究!

        在線咨詢
        關閉
        電話咨詢
        網站制作電話
        010-89941606