(62 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
<script> | <script> | ||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
+ | |||
+ | |||
+ | |||
// When the user scrolls down 20px from the top of the document, slide down the navbar | // When the user scrolls down 20px from the top of the document, slide down the navbar | ||
Line 9: | Line 12: | ||
function scrollFunction() { | function scrollFunction() { | ||
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { | if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { | ||
− | document.getElementById("navbar").style.top = " | + | document.getElementById("navbar").style.top = "18px"; |
} | } | ||
− | |||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 89: | 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 669: | Line 579: | ||
<!--- Menu ---> | <!--- Menu ---> | ||
<!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
− | <div | + | |
− | + | ||
− | <a href=" | + | <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> | |
− | + | ||
− | <a href=" | + | |
+ | |||
</div> | </div> | ||
+ | |||
+ | |||
<!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
<!--- Content of the page ---> | <!--- Content of the page ---> | ||
<!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 13:15, 17 October 2018