123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- header {
- width: 100%;
- height: 110px;
- background-color: #fff;
- position: fixed;
- top: 0;
- left: 0;
- color: #333;
- font-size: 16px;
- z-index: 100;
- }
- header img {
- width: 86px;
- height: 86px;
- margin: 12px;
- }
- header .right {
- height: 86px;
- }
- header .right span {
- margin-left: 105px;
- cursor: pointer;
- }
- header .right span.active {
- color: #D4AA68;
- position: relative;
- }
- header .right span.active::after {
- content: '';
- position: absolute;
- left: 0;
- bottom: -44px;
- width: 100%;
- border: 2px solid #D4AA68;
- background: #D4AA68;
- }
- .flexB {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- </style>
- </head>
- <body>
- <header>
- <div class="banxin flexB">
- <div class="logo">
- <img src="./img/logo.png" alt=""/>
- </div>
- <div class="right flexB">
- <span id="index">首页</span>
- <span id="brand">品牌荣誉</span>
- <span id="notice">新闻动态</span>
- <span id="goods">产品介绍</span>
- <span id="bussiness">招商加盟</span>
- <span id="contact">联系我们</span>
- </div>
- </div>
- </header>
- </body>
- <script src="./js/jquery.js"></script>
- <script>
- $(function () {
- let name0 = window.location.href;
- let names = name0.split('/')
- let real_name = names[names.length - 1];
- let target = real_name.split('.')[0];
- $('#' + target).addClass('active')
- $('span').click(function () {
- $(this).addClass('active').siblings().removeClass('active')
- window.location.href = "./" + $(this).attr('id') + '.html'
- })
- if (!target) {
- $('#index').addClass('active')
- return
- }
- if (target.indexOf('noticeDetail') != -1) {
- $('#notice').addClass('active')
- return
- }
- })
- </script>
- </html>
|