-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
126 lines (89 loc) · 3.79 KB
/
index.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import {navbar, footer} from "./components/navbar.js";
let navbar_div = document.getElementById("nav_container");
navbar_div.innerHTML = navbar();
let footer_content = document.getElementById("foot_cont");
footer_content.innerHTML = footer();
// Sliders Hair Skin Uti
const productContainers = [...document.querySelectorAll('.sproduct-container')];
const nxtBtn = [...document.querySelectorAll('.snxt-btn')];
const preBtn = [...document.querySelectorAll('.spre-btn')];
productContainers.forEach((item, i) => {
let containerDimensions = item.getBoundingClientRect();
let containerWidth = containerDimensions.width;
nxtBtn[i].addEventListener('click', () => {
item.scrollLeft += containerWidth;
})
preBtn[i].addEventListener('click', () => {
item.scrollLeft -= containerWidth;
})
});
// Doctor Health
const dhproductContainers = [...document.querySelectorAll('.dhproduct-container')];
const dhnxtBtn = [...document.querySelectorAll('.dhnxt-btn')];
const dhpreBtn = [...document.querySelectorAll('.dhpre-btn')];
dhproductContainers.forEach((dhitem, i) => {
let containerDimensions = dhitem.getBoundingClientRect();
let containerWidth = containerDimensions.width;
dhnxtBtn[i].addEventListener('click', () => {
dhitem.scrollLeft += containerWidth;
})
dhpreBtn[i].addEventListener('click', () => {
dhitem.scrollLeft -= containerWidth;
})
})
// Doctor experiences
const deproductContainers = [...document.querySelectorAll('.deproduct-container')];
const denxtBtn = [...document.querySelectorAll('.denxt-btn')];
const depreBtn = [...document.querySelectorAll('.depre-btn')];
deproductContainers.forEach((deitem, i) => {
let containerDimensions = deitem.getBoundingClientRect();
let containerWidth = containerDimensions.width;
denxtBtn[i].addEventListener('click', () => {
deitem.scrollLeft += containerWidth;
})
depreBtn[i].addEventListener('click', () => {
deitem.scrollLeft -= containerWidth;
})
})
// before after
const bfafproductContainers = [...document.querySelectorAll('.bfafproduct-container')];
const bfafnxtBtn = [...document.querySelectorAll('.bfafnxt-btn')];
const bfafpreBtn = [...document.querySelectorAll('.bfafpre-btn')];
bfafproductContainers.forEach((bfafitem, i) => {
let containerDimensions = bfafitem.getBoundingClientRect();
let containerWidth = containerDimensions.width;
bfafnxtBtn[i].addEventListener('click', () => {
bfafitem.scrollLeft += containerWidth;
})
bfafpreBtn[i].addEventListener('click', () => {
bfafitem.scrollLeft -= containerWidth;
})
})
// customer review
const custproductContainers = [...document.querySelectorAll('.customerpro-container')];
const custnxtBtn = [...document.querySelectorAll('.custnxt-btn')];
const custpreBtn = [...document.querySelectorAll('.custpre-btn')];
custproductContainers.forEach((cusitem, i) => {
let containerDimensions = cusitem.getBoundingClientRect();
let containerWidth = containerDimensions.width;
custnxtBtn[i].addEventListener('click', () => {
cusitem.scrollLeft += containerWidth;
})
custpreBtn[i].addEventListener('click', () => {
cusitem.scrollLeft -= containerWidth;
})
})
// bodywisehealth
const bhproductContainers = [...document.querySelectorAll('.health-container')];
const bhnxtBtn = [...document.querySelectorAll('.bhnxt-btn')];
const bhpreBtn = [...document.querySelectorAll('.bhpre-btn')];
bhproductContainers.forEach((bhitem, i) => {
let containerDimensions = bhitem.getBoundingClientRect();
let containerWidth = containerDimensions.width;
bhnxtBtn[i].addEventListener('click', () => {
bhitem.scrollLeft += containerWidth;
})
bhpreBtn[i].addEventListener('click', () => {
bhitem.scrollLeft -= containerWidth;
})
});