You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.3 KiB
HTML

<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="sidebarFragment">
<script type=text/javascript>
$(document).ready(function () {
testGetAuth();
})
function testGetAuth() {
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
datatype: "JSON",
async: false,
url: '/rest/test5',
success: function (data) {
data.forEach(function (e, i) {
// console.log("e data: " + JSON.stringify(e))
if (e.level == '2') {
$("#menuList").append('<li><a href="#">' + e.menuName + '</a><ul class="depth' + e.level + '"></ul></li>');
} else if (e.level == '3') {
if (e.level >= e.nextLevel) {
$("#menuList").append('<li><a href="' + e.url + '"><span>' + e.menuName + '</span></a></li>');
} else if (e.nextLevel == '4') {
$("#menuList").append('<li><a href="#">' + e.menuName + '</a><ul class="depth' + e.level + '"></ul></li>');
}
} else if (e.level == '4') {
$("#menuList").append('<li><a href="' + e.url + '"><span>' + e.menuName + '</span></a></li>');
if (e.nextLevel == '2') {
$("#menuList").append('</ul></li>');
} else if (e.nextLevel == '3') {
$("#menuList").append('</ul></li>');
}
}
})
}
})
}
</script>
<style>
header + article {
z-index: 0;
}
</style>
<article>
<div class="lnb_menu_btn_area open">
<a href="#" class="lnb_menu_menu">
<p>메뉴닫기</p>
<span></span>
<span></span>
<span></span>
<span></span>
</a>
</div>
<nav>
<ul class="lnb" id="menuList">
</ul>
</nav>
</article>
</th:block>
</html>