(55 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
− | |||
<script> | <script> | ||
− | + | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
− | + | ||
− | + | ||
− | function | + | |
− | document.getElementById(" | + | |
+ | |||
+ | // 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 = "18px"; | ||
+ | } | ||
} | } | ||
+ | |||
+ | |||
+ | |||
+ | $(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> | </script> | ||
<style> | <style> | ||
− | + | /**************************************************************************************************************************************************************************************************/ | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | |||
/**************************************************************************************************************************************************************************************************/ | /**************************************************************************************************************************************************************************************************/ | ||
/* DEFAULT WIKI SETTINGS */ | /* DEFAULT WIKI SETTINGS */ | ||
Line 44: | Line 81: | ||
+ | .nav_text{ | ||
+ | font-size: 18px; | ||
+ | margin-top: 10px; | ||
+ | padding-top: 35px; | ||
+ | padding-bottom: 35px; | ||
+ | } | ||
+ | .nav_icon { | ||
+ | padding-top: 10px; | ||
+ | padding-bottom: 5px; | ||
+ | } | ||
− | + | #navbar { | |
− | + | background-color: #333; /* Black background color */ | |
− | /* | + | position: fixed; /* Make it stick/fixed */ |
− | + | top: 19px; /* 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) */ | |
} | } | ||
− | /* Style the links | + | /* Style the navbar links */ |
− | + | #navbar a { | |
float: left; | float: left; | ||
display: block; | display: block; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
color: white; | color: white; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
text-decoration: none; | text-decoration: none; | ||
− | + | width: 20%; | |
− | + | text-align: center; | |
− | + | ||
− | |||
− | |||
− | |||
− | |||
} | } | ||
− | + | #navbar a:hover { | |
− | + | ||
background-color: #ddd; | background-color: #ddd; | ||
color: black; | color: black; | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 177: | Line 132: | ||
/*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 600: | Line 555: | ||
/**************************************************************************************************************************************************************************************************/ | /**************************************************************************************************************************************************************************************************/ | ||
+ | |||
Line 606: | Line 562: | ||
</style> | </style> | ||
+ | |||
+ | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
+ | <!--- THIS IS WHERE THE HTML BEGINS ---> | ||
+ | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
<head> | <head> | ||
Line 615: | Line 575: | ||
− | |||
− | <div id=" | + | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
+ | <!--- Menu ---> | ||
+ | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
+ | |||
+ | |||
+ | <div id="navbar"> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <a href="https://2018.igem.org/Team:Melbourne" class="nav_item, nav_text">Home</a> | ||
+ | <a href="https://2018.igem.org/Team:Melbourne/Team" class="nav_item, nav_text">Team</a> | ||
+ | <a href="https://igem.org/2018_Judging_Form?team=Melbourne" class="nav_item, nav_icon"> | ||
+ | <img src="http://www.ampc.ms.unimelb.edu.au/srg/index_files/UOM.png" width="115px", height="95px"> | ||
+ | </a> | ||
+ | <a href="https://2018.igem.org/Team:Melbourne/Project" class="nav_item, nav_text">Project</a> | ||
+ | <a href="https://2018.igem.org/Team:Melbourne/Experiment" class="nav_item, nav_text">Experiment</a> | ||
− | + | </div> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | < | + | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
+ | <!--- Content of the page ---> | ||
+ | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
Latest revision as of 13:15, 17 October 2018