-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
92 lines (74 loc) · 2.6 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
const leftBtn= document.querySelector(".l-btn");
const rightBtn = document.querySelector(".r-btn");
rightBtn.addEventListener("click",
function(event){
const conent=document.querySelector(".product-slide");
conent.scrollLeft +=1100;
event.preventDefault();
})
leftBtn.addEventListener("click",
function(event){
const conent=document.querySelector(".product-slide");
conent.scrollLeft -=1100;
event.preventDefault();
})
const leftBtn1= document.querySelector(".btn-1b");
const rightBtn1 = document.querySelector(".btn-1a");
rightBtn1.addEventListener("click",
function(event){
const conent=document.querySelector(".product-slide-1");
conent.scrollLeft +=1100;
event.preventDefault();
})
leftBtn1.addEventListener("click",
function(event){
const conent=document.querySelector(".product-slide-1");
conent.scrollLeft -=1100;
event.preventDefault();
})
const leftBtn2= document.querySelector(".btn-1c");
const rightBtn2 = document.querySelector(".btn-1d");
rightBtn2.addEventListener("click",
function(event){
const conent=document.querySelector(".product-slide-2");
conent.scrollLeft +=1100;
event.preventDefault();
})
leftBtn2.addEventListener("click",
function(event){
const conent=document.querySelector(".product-slide-2");
conent.scrollLeft -=1100;
event.preventDefault();
})
const backtop = document.querySelector(".backtop");
backtop.addEventListener("click",()=>{
window.scrollTo({
top:0,
behavior:"smooth"
})
})
const sidebar=document.querySelector(".sidebar");
const cross=document.querySelector(".fa-xmark");
const black=document.querySelector(".black");
const sidebtn=document.querySelector(".second-1");
sidebtn.addEventListener("click",()=>{
sidebar.classList.add("active");
cross.classList.add("active");
black.classList.add("active");
document.body.classList.add("stop-scroll");
})
cross.addEventListener("click",()=>{
sidebar.classList.remove("active");
cross.classList.remove("active");
black.classList.remove("active");
document.body.classList.remove("stop-scroll");
})
const sign=document.querySelector(".ac");
const tri=document.querySelector(".triangle");
const signin=document.querySelector(".hdn-sign");
sign.addEventListener("click",()=>{
black.classList.toggle("active-1");
signin.classList.toggle("active");
tri.classList.toggle("active");
document.body.classList.toggle("stop-scroll");
})