Line 1: | Line 1: | ||
<html> | <html> | ||
− | |||
<script> | <script> | ||
− | // | + | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
− | + | ||
− | // | + | // When the user scrolls down 20px from the top of the document, slide down the navbar |
− | + | // When the user scrolls to the top of the page, slide up the navbar (50px out of the top view) | |
+ | window.onscroll = function() {scrollFunction()}; | ||
− | + | function scrollFunction() { | |
− | + | if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { | |
− | + | document.getElementById("navbar").style.top = "0"; | |
− | + | ||
− | function | + | |
− | if ( | + | |
− | + | ||
− | + | ||
− | + | ||
} | } | ||
} | } | ||
− | + | ||
+ | $(document).ready(function() { | ||
− | + | $("#HQ_page").attr('id',''); | |
− | + | ||
− | # | + | |
− | + | ||
− | + | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | / | + | //highlight current page on the menu |
− | . | + | highlight_current_page_menu(); |
− | + | ||
− | } | + | //accessing submenus |
+ | $(".menu_item").click(function(){ | ||
+ | $(".submenu_control_icon", this).toggleClass("open"); | ||
+ | $(this).next(".submenu").fadeToggle(400); | ||
+ | }); | ||
+ | |||
+ | //mobile menu access | ||
+ | $(".igem_2018_team_mobile_bar").click(function(){ | ||
+ | $(this).next().toggleClass("displaying_menu"); | ||
+ | }); | ||
+ | |||
+ | }); | ||
+ | |||
+ | |||
+ | function highlight_current_page_menu() { | ||
+ | |||
+ | var page_url="https://2018.igem.org/"; | ||
+ | page_url = page_url + wgPageName; | ||
+ | $("a[href$='"+ page_url +"']").children().addClass("current_page"); | ||
+ | |||
+ | //if the page is in a submenu, open the submenu and make the appropiate changes | ||
+ | if( $( ".current_page" ).hasClass( "submenu_item" )){ | ||
+ | |||
+ | $(".current_page").parent().parent().fadeToggle(600); | ||
+ | $(".current_page").parent().parent().prev().addClass("current_page"); | ||
+ | $(".menu_item.current_page > .submenu_control_icon").toggleClass("open"); | ||
+ | |||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
+ | </script> | ||
+ | |||
+ | |||
+ | <style> | ||
+ | /**************************************************************************************************************************************************************************************************/ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
/**************************************************************************************************************************************************************************************************/ | /**************************************************************************************************************************************************************************************************/ | ||
/* DEFAULT WIKI SETTINGS */ | /* DEFAULT WIKI SETTINGS */ | ||
Line 75: | Line 80: | ||
− | + | #navbar { | |
− | + | background-color: #333; /* Black background color */ | |
− | + | position: fixed; /* Make it stick/fixed */ | |
− | + | top: 80px; /* Hide the navbar 50 px outside of the top view */ | |
− | /* | + | width: 100%; /* Full width */ |
− | + | transition: top 0.3s; /* Transition effect when sliding down (and up) */ | |
− | + | padding-left: 50px; | |
− | + | ||
} | } | ||
− | /* Style the links | + | /* Style the navbar links */ |
− | + | #navbar a { | |
float: left; | float: left; | ||
display: block; | display: block; | ||
− | color: | + | color: white; |
text-align: center; | text-align: center; | ||
− | padding: | + | padding: 15px; |
text-decoration: none; | text-decoration: none; | ||
− | |||
} | } | ||
− | + | #navbar a:hover { | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
background-color: #ddd; | background-color: #ddd; | ||
color: black; | color: black; | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 206: | Line 111: | ||
/*this wraps the whole of the menu*/ | /*this wraps the whole of the menu*/ | ||
.igem_2018_team_menu { | .igem_2018_team_menu { | ||
− | background-color: #acc7dc; | + | background-color: #acc7dc; |
border-left: 1px solid #c4baba; | border-left: 1px solid #c4baba; | ||
display:block; | display:block; | ||
Line 629: | Line 534: | ||
/**************************************************************************************************************************************************************************************************/ | /**************************************************************************************************************************************************************************************************/ | ||
+ | |||
Line 635: | Line 541: | ||
</style> | </style> | ||
+ | |||
+ | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
+ | <!--- THIS IS WHERE THE HTML BEGINS ---> | ||
+ | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
<head> | <head> | ||
Line 644: | Line 554: | ||
− | < | + | |
+ | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
+ | <!--- Menu ---> | ||
+ | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
<div id="navbar"> | <div id="navbar"> | ||
<a href="#home">Home</a> | <a href="#home">Home</a> | ||
Line 650: | Line 563: | ||
<a href="#contact">Contact</a> | <a href="#contact">Contact</a> | ||
</div> | </div> | ||
+ | |||
+ | |||
+ | |||
+ | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
+ | <!--- Content of the page ---> | ||
+ | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
+ | |||
<div class="igem_2018_team_content"> | <div class="igem_2018_team_content"> | ||
Line 655: | Line 575: | ||
<div class="clear extra_space"></div> | <div class="clear extra_space"></div> | ||
<div class="clear extra_space"></div> | <div class="clear extra_space"></div> | ||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 13:22, 6 October 2018