星火官网,前端页面(前台)
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 7.2KB

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