案例(购物车 以及 轮播图javaScript)

一.购物车

style:
     * {
   
            margin: 0;
            padding: 0;
        }

        table {
   
            border: 1px solid gray;
            border-collapse: collapse;
            width: 500px;
            height: 200px;
            margin: 20px auto;
            text-align: center;
        }
        td,
        th {
   
            border: 1px solid white;
            background-color: lightblue;
        }

        th {
   
            background-color: darkseagreen;
        }

        button {
   
            width: 35px;
        }
html:

    <table>
        <tr>
            <th>商品名称th>
            <th>数量th>
            <th>单价th>
            <th>小计th>
            <th>操作th>
        tr>
        <tr>
            <td>炒细面td>
            <td>
                <button> - button>
                <span class="SingleGoodNum">1span>
                <button> + button>
            td>
            <td>
                单价:<span>10span>
            td>
            <td>
                小计:<span class="SingleGood-TotalPrice">0span>
            td>
            <td>
                操作:<input type="submit" value="删除">
            td>
        tr>
        <tr>
            <td>大闸蟹td>
            <td>
                <button> - button>
                <span class="SingleGoodNum">10span>
                <button> + button>
            td>
            <td>
                单价:<span>298span>
            td>
            <td>
                小计:<span class="SingleGood-TotalPrice">0span>
           

你可能感兴趣的:(javascript,开发语言,ecmascript,前端,算法)