-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
57 lines (33 loc) · 1.03 KB
/
script.js
File metadata and controls
57 lines (33 loc) · 1.03 KB
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
const bar = document.getElementById('bar');
const close = document.getElementById('close');
const nav = document.getElementById('navbar');
if (bar) {
bar.addEventListener('click', ()=>{
nav.classList.add('active')
})
}
if (close) {
close.addEventListener('click', ()=>{
nav.classList.remove('active')
})
}
// redirecting to Single product page information when click on product
const product = document.getElementsByClassName("pro");
// console.log(product);
let imgurl="";
for(let item of product){
item.addEventListener("click", ()=>{
imgurl= item.children[0].src;
console.log(imgurl);
// displaySingleProduct(imgurl)
window.location.href='sproduct.html';
})
}
// console.log(imgurl)
// const sproductPage= document.getElementById('prodetails');
// function displaySingleProduct(){
// console.log("im herer")
// const MainImg=document.getElementById("MainImg");
// console.log(MainImg.src);
// console.log(imgurl);
// }