메뉴 lnb jsp제거

dev_tymeleaf
jangwonseokicom 1 year ago
parent c8617b3345
commit 3d63f2e538

@ -155,6 +155,7 @@ function lnbEvt(){
$('.lnb > li > ul > li > ul').parent().addClass('has_children'); $('.lnb > li > ul > li > ul').parent().addClass('has_children');
} }
$('.lnb > li.has_children > a').attr('href', '#'); $('.lnb > li.has_children > a').attr('href', '#');
$('.lnb > li > a').on('click', function(e){ $('.lnb > li > a').on('click', function(e){
e.preventDefault(); e.preventDefault();

@ -3,17 +3,16 @@
<!-- Footer --> <!-- Footer -->
<th:block th:fragment="footerFragment"> <th:block th:fragment="footerFragment">
<div class="footer row gray-bg" style="">
<div class="col-lg-12"> <script>
<div class="p-sm"> $(document).ready(function () {
<div class="pull-right"> lnbEvt();
<!-- 10GB of <strong>250GB</strong> Free. --> currentPage();
</div> modalUi();
<div> fileupload();
</div> tabUi();
</div> })
</div> </script>
</div>
</th:block> </th:block>
</html> </html>

@ -1,14 +1,35 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"> <html lang="ko" xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="sidebarFragment"> <th:block th:fragment="sidebarFragment">
<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="menuSeq1">
</ul>
</nav>
</article>
<script type=text/javascript> <script type=text/javascript>
$(document).ready(function () { $(document).ready(function () {
testGetAuth(); testGetAuth();
}) }).off(lnbEvt())
function testGetAuth() { function testGetAuth() {
$.ajax({ $.ajax({
@ -18,56 +39,32 @@
async: false, async: false,
url: '/rest/test5', url: '/rest/test5',
success: function (data) { success: function (data) {
data.forEach(function (e, i) { data.forEach(function (e, i) {
// console.log("e data: " + JSON.stringify(e)) var addMenu = '';
if (e.level == '2') { if (!(e.level == '0' || e.level == '1' )&& !$("#menuSeq" + e.seq).length > 0) {
$("#menuList").append('<li><a href="#">' + e.menuName + '</a><ul class="depth' + e.level + '"></ul></li>'); var menuUrl = "#";
} else if (e.level == '3') { if (e.url != '0') {
if (e.level >= e.nextLevel) { menuUrl = e.url;
$("#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') { addMenu += '<li>'
$("#menuList").append('<li><a href="' + e.url + '"><span>' + e.menuName + '</span></a></li>'); + '<a href=' + menuUrl + '>'
if (e.nextLevel == '2') { + '<span>'
$("#menuList").append('</ul></li>'); + e.menuName
} else if (e.nextLevel == '3') { + '</span></a>'
$("#menuList").append('</ul></li>'); + '<ul class="depth' + e.level + '" id="menuSeq' + e.seq + '">'
+ '</ul>'
+ '</li>'
$('#menuSeq' + e.seqUpper).append(addMenu);
} }
}
}) })
} }
}) })
} };
</script> </script>
<style> <script th:src="@{/lib/assets/js/scripts.js}"></script>
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> </th:block>
</html> </html>

Loading…
Cancel
Save