File tree Expand file tree Collapse file tree 1 file changed +72
-0
lines changed
Expand file tree Collapse file tree 1 file changed +72
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ <!DOCTYPE html>
3+ < html lang ="en ">
4+ < head >
5+ < meta charset ="UTF-8 ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
7+ < title > class.cart.js - WebDevLabs</ title >
8+ < link href ="/class.cart.js/assets/css/style.css?v=8190d69dc201fafb67b0e586783467d786178f30 " rel ="stylesheet ">
9+ </ head >
10+ < body >
11+ < div class ="container markdown-body ">
12+ < h1 id ="classcartjs "> class.cart.js</ h1 >
13+ < p > Simple standalone client-side pure JavaScript (< em > ECMAScript 6</ em > ) shopping cart with browser sessionStorage</ p >
14+
15+ < h1 id ="usage "> Usage:</ h1 >
16+ < h2 id ="html "> HTML</ h2 >
17+ < p > < strong > add 2 cart button</ strong > </ p >
18+ < div class ="highlighter-rouge "> < pre class ="highlight "> < code > <button class="add2cart" data-itemid="123" data-title="some product" data-price="12.99">Add 2 cart</button>
19+ </ code > </ pre >
20+ </ div >
21+ < p > < strong > shopping cart div (you can put it anywhere as it’s position is fixed and defined in css)</ strong > </ p >
22+ < div class ="highlighter-rouge "> < pre class ="highlight "> < code > <div id="shoppingCart" data-price="0">
23+ <ul></ul>
24+ <span class="cartBtn">
25+ <i class="glyphicon glyphicon-shopping-cart"></i>
26+ <strong id="cartTotal"></strong>
27+ </span>
28+ </div>
29+ </ code > </ pre >
30+ </ div >
31+ < p > < strong > becouse it is standalone you can load it asynchronously</ strong > </ p >
32+ < div class ="highlighter-rouge "> < pre class ="highlight "> < code > <script src="class.cart.js" async></script>
33+ </ code > </ pre >
34+ </ div >
35+ < h2 id ="css "> CSS</ h2 >
36+ < div class ="highlighter-rouge "> < pre class ="highlight "> < code > #shoppingCart {
37+ display: none;
38+ position: fixed;
39+ right: 17px;
40+ bottom: 0;
41+ z-index: 9999;
42+ opacity: 0.8;
43+ background-color: #ff8040;
44+ border-radius: 7px;
45+ min-width: 100px;
46+ color: black;
47+ }
48+
49+ #shoppingCart ul {
50+ text-align: left;
51+ list-style-type: none;
52+ margin: 10px;
53+ padding: 0;
54+ display: none;
55+ }
56+
57+ #shoppingCart ul li,
58+ .cartBtn {
59+ cursor: pointer;
60+ }
61+
62+ #shoppingCart ul li:hover {
63+ cursor: pointer;
64+ color: white;
65+ text-decoration: line-through;
66+ }
67+ </ code > </ pre >
68+ </ div >
69+
70+ </ div >
71+ </ body >
72+ </ html >
You can’t perform that action at this time.
0 commit comments