-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscript.js
51 lines (40 loc) · 1.38 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const scrollBtn = document.querySelector("#bttop");
scrollBtn.addEventListener("click", () => {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
});
document.addEventListener("scroll",(e) => {
if (document.documentElement.scrollTop <= 400) {
scrollBtn.style.display = "none";
}
else
{
scrollBtn.style.display = "block";
}
});
var data = JSON.parse(localStorage.getItem("cart"));
var len = data.length;
console.log(len);
document.querySelector("#countercart").innerText = len;
// var Redboxdata = [{
// imgUrl:"https://fundamental.in/wp-content/uploads/2022/01/Short-Bannerc-3.1.1.png"
// },{
// imgUrl:"https://fundamental.in/wp-content/uploads/2022/01/Short-Bannerc-4.1.png"
// },{
// imgUrl:"https://fundamental.in/wp-content/uploads/2022/01/Short-Bannerc-5.1.png"
// },{
// imgUrl:"https://fundamental.in/wp-content/uploads/2022/01/Short-Bannerc-1.1.png"
// },{
// imgUrl:"https://fundamental.in/wp-content/uploads/2022/01/Short-Bannerc-2.1.png"
// },{
// imgUrl:"https://fundamental.in/wp-content/uploads/2022/01/Short-Bannerc-6.png"
// }
// ];
// Redboxdata.forEach(function(el){
// var div = document.createElement("div");
// div.setAttribute("id","innerDiv");
// var img = document.createElement("img");
// img.src = el.imgUrl;
// div.append(img);
// document.querySelector("#container_shivam").append(div);
// });