Line 1: | Line 1: | ||
{{NAU-CHINA/ResetCSS}} | {{NAU-CHINA/ResetCSS}} | ||
− | |||
<html> | <html> | ||
<head> | <head> | ||
− | + | <script | |
− | < | + | src="https://code.jquery.com/jquery-3.3.1.js" |
+ | integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" | ||
+ | crossorigin="anonymous"> | ||
+ | </script> | ||
+ | <style type="text/css"> | ||
− | |||
− | + | body { | |
− | + | font-family: 'Goudy Old Style Regular','Helvetica','Arial',sans-serif; | |
− | + | } | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | * { | |
− | + | box-sizing: border-box; | |
− | + | } | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | a:link,a:visited { | |
− | + | color: black !important; | |
− | + | } | |
− | + | ||
− | + | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | .menu-container { | |
+ | width: 100%; | ||
+ | margin: 0 auto; | ||
+ | padding-right: 60px; | ||
+ | /*background: #e9e9e9;*/ | ||
+ | } | ||
− | + | .menu > ul { | |
− | + | margin: 0 auto; | |
− | + | width: 100%; | |
− | + | list-style: none; | |
− | + | padding: 0; | |
+ | position: relative; | ||
+ | /* IF .menu position=relative -> ul = container width, ELSE ul = 100% width */ | ||
+ | box-sizing: border-box; | ||
+ | } | ||
− | + | .menu > ul:before, | |
− | + | .menu > ul:after { | |
− | + | content: ""; | |
− | + | display: table; | |
+ | } | ||
− | + | .menu > ul:after { | |
+ | clear: both; | ||
+ | } | ||
+ | .menu > ul > li { | ||
+ | float: right; | ||
+ | /*background: #e9e9e9;*/ | ||
+ | padding: 0; | ||
+ | margin: 0; | ||
+ | } | ||
+ | |||
+ | .menu > ul > li a { | ||
+ | text-decoration: none; | ||
+ | padding: 1.5em 1.5em; | ||
+ | display: block; | ||
+ | } | ||
+ | |||
+ | .menu > ul > li:hover { | ||
+ | background: #f0f0f0; | ||
+ | transition: linear 0.5s; | ||
+ | } | ||
+ | |||
+ | .menu > ul > li > ul { | ||
+ | display: none; | ||
+ | width: 100%; | ||
+ | background-color: whitesmoke; | ||
+ | /*padding: 20px;*/ | ||
+ | position: absolute; | ||
+ | z-index: 99; | ||
+ | left: 0; | ||
+ | margin: 0; | ||
+ | list-style: none; | ||
+ | box-sizing: border-box; | ||
+ | } | ||
+ | |||
+ | .menu > ul > li > ul:before, | ||
+ | .menu > ul > li > ul:after { | ||
+ | content: ""; | ||
+ | display: table; | ||
+ | } | ||
+ | |||
+ | .menu > ul > li > ul:after { | ||
+ | clear: both; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | .menu > ul > li > ul > li a { | ||
+ | color: #777; | ||
+ | /*padding: .2em 0;*/ | ||
+ | width: 100%; | ||
+ | display: block; | ||
+ | border-bottom: 1px solid #ccc; | ||
+ | } | ||
+ | |||
+ | .menu > ul > li > ul.normal-sub { | ||
+ | width: 200px; | ||
+ | left: auto; | ||
+ | padding: 10px 20px; | ||
+ | } | ||
+ | |||
+ | .menu > ul > li > ul.normal-sub:before { | ||
+ | width: 40px; | ||
+ | |||
+ | } | ||
+ | |||
+ | .menu > ul > li > ul.normal-sub > li { | ||
+ | width: 100%; | ||
+ | } | ||
+ | |||
+ | .menu > ul > li > ul.normal-sub > li a { | ||
+ | border: 0; | ||
+ | padding: 1em 0; | ||
+ | } | ||
+ | |||
+ | |||
+ | </style> | ||
</head> | </head> | ||
<body> | <body> | ||
− | <div | + | <div class="menu-container"> |
+ | <div class="menu"> | ||
+ | <ul> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Human_Practices">Human Practices</a></li> | ||
+ | |||
+ | |||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Notebook">Notebook</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Safety">Safety</a></li> | ||
+ | |||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Model">Model</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Software">Software</a></li> | ||
+ | <li><a href="#">Project</a> | ||
+ | <ul> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Application_prospects">Application prospects</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Parts">Parts</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Protocols">Protocols</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Results">Results</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Demonstrate">Demonstrate</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Overview">Overview</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Design">Design</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/InterLab">Interlab</a></li> | ||
+ | </ul> | ||
+ | </li> | ||
+ | <li><a href="#">Team</a> | ||
+ | <ul> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Team_members">Team members</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Collaborations">Collaborations</a></li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA/Attributions">Attributions</a></li> | ||
+ | </ul> | ||
+ | </li> | ||
+ | <li><a href="https://2018.igem.org/Team:NAU-CHINA">Home</a></li> | ||
+ | |||
+ | |||
+ | </ul> | ||
+ | </div> | ||
+ | </div> | ||
+ | |||
+ | |||
+ | <script> | ||
+ | /*global $ */ | ||
+ | $(document).ready(function () { | ||
+ | |||
+ | "use strict"; | ||
+ | |||
+ | |||
+ | $('.menu > ul > li > ul:not(:has(ul))').addClass('normal-sub'); | ||
+ | //Checks if drodown menu's li elements have anothere level (ul), if not the dropdown is shown as regular dropdown, not a mega menu (thanks Luka Kladaric) | ||
+ | $(".menu > ul > li").hover(function (e) { | ||
+ | if ($(window).width() > 943) { | ||
+ | $(this).children("ul").stop(true, false).fadeToggle(100); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | }); | ||
+ | //If width is more than 943px dropdowns are displayed on hover | ||
− | + | $(".menu > ul > li").click(function (e) { | |
− | </ | + | if ($(window).width() <= 943) { |
+ | $(this).children("ul").fadeToggle(150); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | }); | ||
+ | </script> |
Revision as of 09:11, 1 October 2018