作者:小符
撰写时间:2019.5.7
今天我来给大家讲解一下,购物车计算的代码。
首先,写一下基本的样式:
<style>
* {
margin: 0;
padding: 0; }
a {
color: #666;
text-decoration: none; }
table {
width: 535px; }
th, td {
border: 1px solid #CADEFF; }
tbody tr:hover {
background: RGB(238,246,255); }
.checkbox {
width: 60px; }
.goods {
width: 100px; }
.count .add, .count .reduce {
border: 1px solid #e5e5e5; }
.count .add:hover, .count .reduce:hover {
color: #f50; }
.count input {
width: 50px;
border: 1px solid #aaa;
text-align: center;
padding: 4px 0; }
.subtotal {
color: red; }
.foot #priceTotal, .foot #selectedTotal {
color: red;
font-weight: bold; }
<body>
<table id="cartTable">
<thead>
<tr>
<th><label><input class="check-all check" type="checkbox" /> 全选</label></th&