-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.html
43 lines (37 loc) · 992 Bytes
/
menu.html
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
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<script>
var Now = new Date();
var currentHour = Now.getHours(); // 0-23
$(document).ready(function(){
if (currentHour > 3 && currentHour < 15) {
$('.secondmenu').addClass('hiddenmenu');
$('.thirdmenu').addClass('hiddenmenu');
console.log('lunch');
console.log(currentHour);
} else if (currentHour >= 15 && currentHour < 22) {
$('.firstmenu').addClass('hiddenmenu');
$('.thirdmenu').addClass('hiddenmenu');
console.log('dinner');
console.log(currentHour);
} else {
$('.firstmenu').addClass('hiddenmenu');
$('.secondmenu').addClass('hiddenmenu');
console.log('late');
}
});
</script>
<div class="rte">
<div class="firstmenu">
lunch
</div>
<div class="secondmenu">
dinner
</div>
<div class="thirdmenu">
late night
</div>
plus drinks
</div>
</div>