官网 管理后台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

header.html 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. <style>
  9. html,
  10. body {
  11. margin: 0;
  12. padding: 0;
  13. }
  14. .header_html_root {
  15. display: flex;
  16. justify-content: space-between;
  17. align-items: center;
  18. margin: 0 auto;
  19. width: 1000px;
  20. font-size: 16px;
  21. line-height: 50px;
  22. font-weight: bold;
  23. box-sizing: border-box;
  24. }
  25. .header_html_root .header_html_item {
  26. margin: 0 24px;
  27. padding: 0 10px;
  28. color: #333;
  29. border-bottom: 4px solid transparent;
  30. cursor: pointer;
  31. }
  32. .header_html_root .header_html_item:hover,
  33. .header_html_root .header_html_item.selected {
  34. border-bottom: 4px solid #2d8cf0;
  35. }
  36. </style>
  37. </head>
  38. <body>
  39. <div class="header_html_root">
  40. <div class="header_html_item" data-url="index">用户信息</div>
  41. <div class="header_html_item" data-url="history">发展历程</div>
  42. <div class="header_html_item" data-url="service">服务案例</div>
  43. <div class="header_html_item" data-url="school">学校图标</div>
  44. <div class="header_html_item" data-url="trial">申请试用</div>
  45. <div class="header_html_item" data-url="news">新闻资讯</div>
  46. <div class="header_html_item" data-url="log">登录日志</div>
  47. </div>
  48. <script>
  49. let page_url = $(".top_header_root").data("header_page");
  50. $('.header_html_root .header_html_item[data-url="' + page_url + '"]').addClass("selected");
  51. $(".header_html_root").on("click", ".header_html_item", function () {
  52. let _url = $(this).data("url");
  53. if (_url === "index") {
  54. window.location.href = "/index.html";
  55. } else {
  56. window.location.href = "/sections/" + _url + ".html";
  57. }
  58. });
  59. </script>
  60. </body>
  61. </html>