headerNav.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <headerNav>
  2. <div class="mainmenu-area container">
  3. <div class="d-flex align-items-center justify-content-between">
  4. <nav class="main-menu">
  5. <div class="logo">
  6. <a href="/index.html"><img src="../assets/img/logo-white.png" alt="uskylogo"></a>
  7. </div>
  8. <div class="menu-items" >
  9. <ul>
  10. <li></li>
  11. <!-- <li>
  12. <a href="../../index.html">首页</a>
  13. </li>
  14. <li>
  15. <a href="../../solution/index.html?solution_type=1">解决方案</a>
  16. <ul class="submenu">
  17. <li><a href="../../solution/index.html?solution_type=1">智慧安防</a></li>
  18. <li><a href="../../solution/index.html?solution_type=2">智慧消防</a></li>
  19. <li><a href="../../solution/index.html?solution_type=3">智慧建筑能源管理</a></li>
  20. <li><a href="../../solution/index.html?solution_type=4">智慧电力综合管理</a></li>
  21. <li><a href="../../solution/index.html?solution_type=5">智慧园区无人机综合管理</a></li>
  22. <li><a href="../../solution/index.html?solution_type=6">智慧楼宇综合运营</a></li>
  23. </ul>
  24. </li>
  25. <li>
  26. <a href="../../product/index.html">产品服务</a>
  27. </li>
  28. <li>
  29. <a href="../../technology/index.html">技术支撑</a>
  30. </li>
  31. <li class="active">
  32. <a href="../../news/index.html">新闻动态</a>
  33. <ul class="submenu">
  34. <li><a href="../../news/index.html">公司新闻</a></li>
  35. <li><a href="../../news/trade/index.html">行业动态</a></li>
  36. </ul>
  37. </li>
  38. <li>
  39. <a href="../../about/index.html">关于我们</a>
  40. </li> -->
  41. </ul>
  42. </div>
  43. </nav>
  44. </div>
  45. </div>
  46. <script src="../assets/js/vendor/jquery-1.12.4.min.js "></script>
  47. <script>
  48. $(function() {
  49. $.ajax({
  50. type: 'get',
  51. dataType: 'json',
  52. url: window.FQDN2 + 'siteCategory/siteCategoryList',
  53. }).done(function(res) {
  54. for (let i = 0; i < res.data.length; i++) {
  55. // console.log(res.data[i].sname)
  56. // console.log(window.location.pathname)
  57. var li = $(`<li><a href = ${res.data[i].sname}>${res.data[i].categoryName}</a></li>`)
  58. if (res.data[i].children.length > 0) {
  59. var ul = $(`<ul class="submenu"></ul>`)
  60. for (let a = 0; a < res.data[i].children.length; a++) {
  61. var li2 = $(`<li>
  62. <a href=${res.data[i].sname}?id=${res.data[i].children[a].id}>${res.data[i].children[a].categoryName}</a>
  63. </li>`)
  64. ul.append(li2)
  65. }
  66. li.append(ul)
  67. }
  68. $(".menu-items>ul").append(li)
  69. }
  70. $(".menu-items ul li").hover(function() {
  71. // if ($(this).find(".submenu")) {
  72. // $(".erMenu>div>.erMenuList").remove()
  73. // const data = $(this).children(".submenu").clone()
  74. // if(data){
  75. // $(".erMenu>div").append(data)
  76. // $(".erMenu>div>.submenu").addClass("erMenuList").removeClass("submenu")
  77. // $(".erMenu").fadeIn()
  78. // }
  79. // } else {
  80. // $(".erMenu").fadeOut()
  81. // }
  82. });
  83. $(".menu-items ul li").click(function() {
  84. // $(this).addClass("menuactive")
  85. })
  86. // $(".erMenu").hover(function() {
  87. // }, function() {
  88. // $(".erMenu").fadeOut()
  89. // })
  90. }).fail(function(err) {});
  91. });
  92. </script>
  93. </headerNav>