星火官网,前端页面(前台)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

header.html 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  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. .header_box {
  10. position: relative;
  11. margin: 0 auto;
  12. width: 13rem;
  13. height: 0.8rem;
  14. font-size: 0.14rem;
  15. }
  16. .header_box .header_left {
  17. float: left;
  18. cursor: pointer;
  19. }
  20. .header_box .header_left > img {
  21. display: inline-block;
  22. margin-top: 0.24rem;
  23. margin-right: 0.08rem;
  24. height: 0.32rem;
  25. }
  26. .header_box .header_left .left_white {
  27. display: inline-block;
  28. }
  29. .header_box .header_left .left_gray {
  30. display: none;
  31. }
  32. .header_box .header_right {
  33. float: right;
  34. }
  35. .header_box .header_right > .header_nav_item {
  36. position: relative;
  37. float: left;
  38. margin-left: 0.55rem;
  39. height: 0.8rem;
  40. line-height: 0.8rem;
  41. cursor: pointer;
  42. }
  43. .header_box .header_right > .header_nav_lang {
  44. position: relative;
  45. float: left;
  46. margin-left: 0.55rem;
  47. height: 0.8rem;
  48. line-height: 0.8rem;
  49. cursor: pointer;
  50. }
  51. .header_box .header_right > .header_nav_item > div::after {
  52. content: "";
  53. width: 0;
  54. position: absolute;
  55. background: #2d8cf0;
  56. height: 0.04rem;
  57. bottom: 0;
  58. left: 50%;
  59. transform: translateX(-50%);
  60. -webkit-transform: translateX(-50%);
  61. transition: all 0.3s ease-out;
  62. -webkit-transition: all 0.3s ease-out;
  63. }
  64. .header_box .header_right > .header_nav_item:hover > div::after,
  65. .header_box .header_right > .header_nav_item.selected > div::after {
  66. width: 100%;
  67. }
  68. .header_box .header_right > .header_nav_lang .nav_language_en {
  69. background-color: #2d8cf0;
  70. position: absolute;
  71. top: 0.6rem;
  72. left: 50%;
  73. transform: translateX(-50%) translateY(50%);
  74. -webkit-transform: translateX(-50%) translateY(50%);
  75. padding: 0.06rem 0;
  76. -webkit-transition: all 0.2s ease-in-out;
  77. transition: all 0.2s ease-in-out;
  78. visibility: hidden;
  79. opacity: 0;
  80. z-index: 100;
  81. text-align: center;
  82. font-size: 0.14rem;
  83. line-height: 0.4rem;
  84. color: #fff;
  85. border-radius: 0.08rem;
  86. }
  87. .header_box .header_right > .header_nav_lang:hover .nav_language_en {
  88. display: block;
  89. visibility: visible;
  90. transform: translateX(-50%) translateY(0%);
  91. -webkit-transform: translateX(-50%) translateY(0%);
  92. opacity: 1;
  93. }
  94. .header_box
  95. .header_right
  96. > .header_nav_lang:hover
  97. .nav_language_en::after {
  98. border-left: 0.07rem solid transparent;
  99. border-right: 0.07rem solid transparent;
  100. border-top: 0.09660254rem solid #2d8cf0;
  101. width: 0;
  102. height: 0;
  103. content: "";
  104. position: absolute;
  105. top: -0.08rem;
  106. left: 50%;
  107. transform: translateX(-50%) rotate(180deg);
  108. -webkit-transform: translateX(-50%) rotate(180deg);
  109. }
  110. .header_box .header_right > .header_nav_lang:hover .nav_language_en a {
  111. color: #fff;
  112. display: block;
  113. padding: 0;
  114. margin: 0 0.12rem;
  115. transition: all 0.3s ease-out;
  116. -webkit-transition: all 0.3s ease-out;
  117. text-decoration: none;
  118. }
  119. </style>
  120. </head>
  121. <body>
  122. <div class="header_box">
  123. <div class="header_left">
  124. <img class="left_white" src="../../img/logo_info/header_logo.png" />
  125. <img class="left_white" src="../../img/logo_info/header_title.png" />
  126. <img class="left_gray" src="../../img/logo_info/header_logo1.png" />
  127. <img class="left_gray" src="../../img/logo_info/header_title1.png" />
  128. </div>
  129. <div class="header_right">
  130. <div data-nav="1" class="header_nav_item nav_1">
  131. <div>产品中心</div>
  132. </div>
  133. <div data-nav="2" class="header_nav_item nav_2">
  134. <div>服务案例</div>
  135. </div>
  136. <div data-nav="3" class="header_nav_item nav_3">
  137. <div>关于我们</div>
  138. </div>
  139. <div data-nav="4" class="header_nav_item nav_4">
  140. <div>申请试用</div>
  141. </div>
  142. <div data-nav="5" class="header_nav_item nav_5">
  143. <div>新闻资讯</div>
  144. </div>
  145. <div data-nav="6" class="header_nav_item nav_6">
  146. <div>中文 | English</div>
  147. </div>
  148. <!-- <div class="header_nav_lang">
  149. 中文
  150. <div class="nav_language_en">
  151. <a href="#" target="_blank">English</a>
  152. </div>
  153. </div> -->
  154. </div>
  155. </div>
  156. <script>
  157. $(function() {
  158. $(".header_box .header_left").click(function () {
  159. window.location.href = "/index.html";
  160. });
  161. let nav_info = $(".header_root").data("nav_info");
  162. $(".header_box > .header_right > .header_nav_item").removeClass("selected");
  163. if (nav_info) {
  164. $(".header_box > .header_right > .header_nav_item.nav_" + nav_info).addClass("selected");
  165. }
  166. $(".header_box > .header_right").on("click", ".header_nav_item", function (ev) {
  167. $(".header_box > .header_right > .header_nav_item").removeClass("selected");
  168. let nav_num = $(this).data("nav");
  169. $(".header_box > .header_right > .header_nav_item.nav_" + nav_num).addClass("selected");
  170. if (nav_num === 1) {
  171. window.location.href = "/sections/product.html";
  172. } else if (nav_num === 2) {
  173. window.location.href = "/sections/service.html";
  174. } else if (nav_num === 3) {
  175. window.location.href = "/sections/about.html";
  176. } else if (nav_num === 4) {
  177. window.location.href = "/sections/trial.html";
  178. } else if (nav_num === 5) {
  179. window.location.href = "/sections/news.html";
  180. } else if (nav_num === 6) {
  181. console.log("语言切换");
  182. }
  183. });
  184. let _pathname = window.location.pathname;
  185. if (_pathname === "/index.html" || _pathname === "/") {
  186. $(window).on("scroll", function() {
  187. let top = $(window).scrollTop();
  188. if(top > 100){
  189. $(".header_root").addClass("bg_white");
  190. } else {
  191. $(".header_root").removeClass("bg_white");
  192. }
  193. });
  194. }
  195. });
  196. </script>
  197. </body>
  198. </html>