Rumah > php教程 > php手册 > teks badan

购物车前台页面代码

WBOY
Lepaskan: 2016-06-07 11:43:53
asal
978 orang telah melayarinya

购物车前台页面代码, 这只是个小例子, 具体可以自由发挥
nbsp;html><br> <br> <br>     <meta> <br>     <title>购物车自动计价</title> <br>     <script></script><br>     <script><br /> $(function(){<br /> $(".se").change(function(oEven) {<br /> var num = $(this).find("option:selected").text();<br /> var price = $(this).parent().next().text();<br /> $(this).parent().next().next().text(num*price);<br /> GetInAll();//计算所有物品价格<br /> });<br /> })<br /> <br /> function GetInAll()<br /> {<br /> var len = $("#PriceTable tbody").children("tr").length;<br /> var priceCount=0;<br /> for(var i=0;i<len;i++)<br /> {<br /> // var tempData=rows[i];<br /> var price1 = $("#PriceTable tbody tr:eq("+i+") td:eq(4)").text();<br /> priceCount=parseFloat(priceCount)+parseFloat(price1);<br /> }<br /> $("#PriceTable tfoot tr td:eq(1)").text(priceCount);<br /> }<br /> </script><br>     <style><br /> table input[type=text]{ width:32px;}<br /> </style> <br> <br> <br> <br>     <div> <br>        <table> <br>          <thead><tr> <td>物品编号</td> <td>物品名称</td> <td>数量</td> <td>价格</td> <td>小计</td> </tr></thead> <br>          <tbody> <br>             <tr> <br>                 <td>jsp_123</td> <br>                 <td>电脑</td> <br>                 <td> <br>                     <select><br>                         <option>1</option> <br>                         <option>2</option> <br>                         <option>3</option> <br>                         <option>4</option> <br>                         <option>5</option> <br>                     </select><br>                 </td> <br>                 <td>1950</td> <br>                 <td>1950</td> <br>             </tr> <br>             <tr> <br>                 <td>jsp_123</td> <br>                 <td>电脑</td> <br>                 <td> <br>                     <select><br>                         <option>1</option> <br>                         <option>2</option> <br>                         <option>3</option> <br>                         <option>4</option> <br>                         <option>5</option> <br>                     </select><br>                 </td> <br>                 <td>1950</td> <br>                 <td>1950</td> <br>             </tr> <br>             <tr> <br>                 <td>jsp_123</td> <br>                 <td>电脑</td> <br>                 <td> <br>                     <select><br>                         <option>1</option> <br>                         <option>2</option> <br>                         <option>3</option> <br>                         <option>4</option> <br>                         <option>5</option> <br>                     </select><br>                 </td> <br>                 <td>1950</td> <br>                 <td>1950</td> <br>             </tr> <br>            <br>          </tbody> <br>          <tfoot> <br>            <tr> <td>总计:</td> <td>5850</td> </tr> <br>          </tfoot> <br>        </table> <br>     </div> <br>     <input><br> <br>

AD:真正免费,域名+虚机+企业邮箱=0元

sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Cadangan popular
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan