-
Notifications
You must be signed in to change notification settings - Fork 0
/
navbar_trash.html
105 lines (98 loc) · 3.25 KB
/
navbar_trash.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="//dapi.kakao.com/v2/maps/sdk.js?appkey=980cb5bdc84e332d75c476760f95cb73"></script>
<link rel="stylesheet" href="css/style.css">
<title></title>
</head>
<body>
<script src="js/app.common.js"></script>
<div class="wrap">
<div class="dropdown">
<div class="wrap_btn">
<button class="dropbtn">
<span class="dropbtn_content" onmouseover="dropdown()">Select a menu</span>
<span class="drop icon" style="font-family: Material Icons; font-size : 16px; color : #3b3b3b; float:right;"
>arrow_drop_down</span>
</button>
</div>
</div>
<div class="wrap_content">
<div class="dropdown-content">
<div class="fastfood" onclick="showMenu(this.innerText)">화장실</div>
<div class="fastfood" onclick="showMenu(this.innerText)">흡연부스</div>
<div class="fastfood" onclick="showMenu(this.innerText)">쓰레기통</div>
<div class="fastfood" onclick="showMenu(this.innerText)">주차장</div>
</div>
</div>
</div>
<div id="skech_map">
<script>
$(document).ready(function(){
$("#skech_map").load("m_trash.htm");
$(".dropbtn_content").text("쓰레기통");
});
</script>
</div>
</div>
<script>
</script>
<script>
window.onload=()=>{
document.querySelector('.dropbtn_content').onmouseover = ()=>{
dropdown();
}
document.getElementsByClassName('fastfood').onclick = ()=>{
showMenu(value);
};
dropdown = () => {
var v = document.querySelector('.dropdown-content');
var dropbtn = document.querySelector('.dropbtn')
v.classList.toggle('show');
}
showMenu=(value)=>{
var dropbtn_content = document.querySelector('.dropbtn_content');
var dropbtn_click = document.querySelector('.dropbtn_click');
var dropbtn = document.querySelector('.dropbtn');
dropbtn_content.innerText = value;
dropbtn_content.style.color = '#252525';
if(value=="흡연부스"){
$(document).ready(function(){
$("#skech_map").load("m_smoke.htm");
})
}else if(value=="쓰레기통"){
$(document).ready(function(){
$("#skech_map").load("m_trash.htm");
})
}else if(value=="주차장"){
$(document).ready(function(){
$("#skech_map").load("m_car.htm");
})
}else if(value=="화장실"){
$(document).ready(function(){
$("#skech_map").load("m_rest.htm");
})
}
}
}
window.onclick= (e)=>{
if(!e.target.matches('.dropbtn_click')){
var dropdowns = document.getElementsByClassName("dropdown-content");
var dropbtn_content = document.querySelector('.dropbtn_content');
var dropbtn_click = document.querySelector('.dropbtn_click');
var dropbtn = document.querySelector('.dropbtn');
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}</script>
</body>
</html>