| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <%@ page pageEncoding="UTF-8"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <c:set var="headerBackgroundImage" value="${empty deptHeroNmv.articleList[0].thumbnail ? '/main/ffkj-portal/news-red/hero-building.jpg' : deptHeroNmv.articleList[0].thumbnail}"/>
- <header class="hero-head" style="--hero-bg:url('${headerBackgroundImage}')">
- <div class="head-inner">
- <div class="top-links">
- <c:choose>
- <c:when test="${not empty utilityLinksNmv.articleList}">
- <c:forEach items="${utilityLinksNmv.articleList}" var="item" varStatus="vs">
- <c:if test="${not vs.first}"><b>|</b></c:if>
- <a href="${item.url}" target="${item.target}">${item.title}</a>
- </c:forEach>
- </c:when>
- <c:otherwise><a href="/">学校首页</a><b>|</b><a href="/">新闻首页</a></c:otherwise>
- </c:choose>
- </div>
- <a class="brand" href="/" aria-label="${empty website.seoTitle ? website.name : website.seoTitle}首页">
- <c:if test="${not empty website.logo}"><img class="brand-logo" src="${website.logo}" alt="${website.name}"></c:if>
- <span class="brand-name">${empty website.seoTitle ? website.name : website.seoTitle}</span>
- </a>
- <form class="search" action="/search" method="get"><input name="str" value="${str}" placeholder="站内" aria-label="站内搜索"><button type="submit">搜索</button></form>
- </div>
- </header>
- <button class="mobile-nav-toggle" type="button" aria-label="打开导航" aria-expanded="false"><span></span><span></span><span></span></button>
- <nav class="main-nav" aria-label="主导航"><ul>
- <li class="mobile-nav-search-item"><form class="mobile-nav-search" action="/search" method="get"><input name="str" value="${str}" placeholder="站内" aria-label="站内搜索"><button type="submit">搜索</button></form></li>
- <li><a class="${empty navigation ? 'active' : ''}" href="/">首页</a></li>
- <c:forEach items="${navList}" var="item">
- <c:if test="${item.name ne '首页' and item.name ne '首页子栏目'}">
- <li class="${not empty item.children ? 'has-children' : ''}">
- <a class="${item.navigationid eq navigation.navigationid or item.navigationid eq navigation.parentNid ? 'active' : ''}" href="${item.href}" target="${item.target}">${item.name}</a>
- <c:if test="${not empty item.children}">
- <ul class="dept-nav-panel">
- <c:forEach items="${item.children}" var="child"><li><a href="${child.href}" target="${child.target}">${child.name}</a></li></c:forEach>
- </ul>
- </c:if>
- </li>
- </c:if>
- </c:forEach>
- </ul></nav>
- <div class="mobile-nav-mask" aria-hidden="true"></div>
- <script>
- (function () {
- var toggle = document.querySelector('.mobile-nav-toggle');
- var nav = document.querySelector('.main-nav');
- var mask = document.querySelector('.mobile-nav-mask');
- if (!toggle || !nav || !mask) return;
- function setOpen(open) {
- nav.classList.toggle('is-open', open);
- mask.classList.toggle('is-open', open);
- toggle.classList.toggle('is-open', open);
- toggle.setAttribute('aria-expanded', open ? 'true' : 'false');
- document.documentElement.style.overflow = open ? 'hidden' : '';
- }
- toggle.addEventListener('click', function () {
- setOpen(!nav.classList.contains('is-open'));
- });
- mask.addEventListener('click', function () { setOpen(false); });
- Array.prototype.forEach.call(nav.querySelectorAll('a'), function (link) {
- link.addEventListener('click', function () { setOpen(false); });
- });
- document.addEventListener('keydown', function (event) {
- if (event.key === 'Escape') setOpen(false);
- });
- })();
- </script>
|