-
Notifications
You must be signed in to change notification settings - Fork 1
/
fs.js
55 lines (53 loc) · 1.68 KB
/
fs.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
const coutDown = (hour, minute, second) => {
setInterval(
(time = () => {
var d = new Date();
let hours = hour - 1 - d.getHours();
let min = minute - d.getMinutes();
if ((min + "").length == 1) {
min = "0" + min;
}
let sec = second - d.getSeconds();
if ((sec + "").length == 1) {
sec = "0" + sec;
}
$("#the-24h-countdown p").html(
"<span>" +
hours +
'</span><span class="min">' +
min +
'<br></span><span class="seg">' +
sec +
"</span>"
);
}),
1000
);
};
coutDown(24, 60, 60);
$(".navbar-with-more-menu__more").mouseenter(function() {
$(".navbar-with-more-menu__more").addClass("show");
$(".more-menu").addClass("open");
});
$(".navbar-with-more-menu__more").mouseleave(function() {
$(".navbar-with-more-menu__more").removeClass("show");
$(".more-menu").removeClass("open");
});
$(window).scroll(function() {
let scroll = $(document).scrollTop();
if (scroll >= 10) {
$(".flash-sale-header-with-countdown-timer").addClass("ticky");
} else {
$(".flash-sale-header-with-countdown-timer").removeClass("ticky");
}
if (
$(window).scrollTop() >
$(".flash-sale-header-with-countdown-timer").outerHeight() +
$(".flash-sale-banner").outerHeight() - 70
) {
$(".inside-page__menu").addClass("sticky");
$(".image-carousel__item-list").addClass("sticky");
} else {
$(".image-carousel__item-list").removeClass("sticky");
}
});