Edwinlawisan (Talk | contribs) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 200: | Line 200: | ||
.navbar{ | .navbar{ | ||
margin:0px;border:0px;} | margin:0px;border:0px;} | ||
+ | #myBtn { | ||
+ | display: none; | ||
+ | position: fixed; | ||
+ | bottom: 20px; | ||
+ | right: 30px; | ||
+ | z-index: 99; | ||
+ | font-size: 18px; | ||
+ | border: none; | ||
+ | outline: none; | ||
+ | background-color:transparent; | ||
+ | color: white; | ||
+ | cursor: pointer; | ||
+ | padding: 15px; | ||
+ | border-radius: 4px; | ||
+ | } | ||
+ | |||
+ | #myBtn:hover { | ||
+ | background-color: #555; | ||
+ | } | ||
</style> | </style> | ||
<body> | <body> | ||
+ | <button onclick="topFunction()" id="myBtn" title="Go to top"><img src="https://image.flaticon.com/icons/png/512/14/14747.png" style="width:50px;height:50px;"></button> | ||
<!-- Navbar --> | <!-- Navbar --> | ||
<nav class="navbar navbar-default"> | <nav class="navbar navbar-default"> | ||
Line 238: | Line 258: | ||
</li> | </li> | ||
<li class="navbar-model"><a href="https://2018.igem.org/Team:UI_Indonesia/Model">Model</a></li> | <li class="navbar-model"><a href="https://2018.igem.org/Team:UI_Indonesia/Model">Model</a></li> | ||
− | <li class="dropdown navbar-humanpractice"> | + | < <li class="dropdown navbar-humanpractice"> |
− | <a href="https://2018.igem.org/Team:UI_Indonesia/ | + | <a href="https://2018.igem.org/Team:UI_Indonesia/Human_Practices">Human Practices<span class="caret"></span></a> |
<ul class="dropdown-menu"> | <ul class="dropdown-menu"> | ||
− | <li><a href="https://2018.igem.org/Team:UI_Indonesia/ | + | <li><a href="https://2018.igem.org/Team:UI_Indonesia/Human_Practices">Integrated Human Practice</a></li> |
− | <li><a href="https://2018.igem.org/Team:UI_Indonesia/ | + | <li><a href="https://2018.igem.org/Team:UI_Indonesia/Public_Engagement">Education and Public Engagement</a></li> |
− | <li><a href="https://2018.igem.org/Team:UI_Indonesia/ | + | <li><a href="https://2018.igem.org/Team:UI_Indonesia/Human_Practices#catalogue">Human Practice Catalogue</a></li> |
− | + | ||
</ul> | </ul> | ||
− | + | </li> | |
<li class="navbar-improve current"><a href="https://2018.igem.org/Team:UI_Indonesia/Improve">Improve</a></li> | <li class="navbar-improve current"><a href="https://2018.igem.org/Team:UI_Indonesia/Improve">Improve</a></li> | ||
<li class="navbar-team"><a href="https://2018.igem.org/Team:UI_Indonesia/Team">Team</a></li> | <li class="navbar-team"><a href="https://2018.igem.org/Team:UI_Indonesia/Team">Team</a></li> | ||
<li class="navbar-collaborations"><a href="https://2018.igem.org/Team:UI_Indonesia/Collaborations">Collaborations</a></li> | <li class="navbar-collaborations"><a href="https://2018.igem.org/Team:UI_Indonesia/Collaborations">Collaborations</a></li> | ||
− | + | <li class="dropdown navbar-attributions"> | |
+ | <a href="https://2018.igem.org/Team:UI_Indonesia/Attributions">Attributions<span class="caret"></span></a> | ||
+ | <ul class="dropdown-menu"> | ||
+ | <li><a href="https://2018.igem.org/Team:UI_Indonesia/MedalCriteria">Medal Criteria</a></li> | ||
+ | </ul> | ||
+ | </li> | ||
</ul> | </ul> | ||
</div> | </div> | ||
Line 432: | Line 456: | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | ||
+ | <script> | ||
+ | // When the user scrolls down 20px from the top of the document, show the button | ||
+ | window.onscroll = function() {scrollFunction()}; | ||
+ | |||
+ | function scrollFunction() { | ||
+ | if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { | ||
+ | document.getElementById("myBtn").style.display = "block"; | ||
+ | } else { | ||
+ | document.getElementById("myBtn").style.display = "none"; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // When the user clicks on the button, scroll to the top of the document | ||
+ | function topFunction() { | ||
+ | document.body.scrollTop = 0; | ||
+ | document.documentElement.scrollTop = 0; | ||
+ | } | ||
+ | </script> | ||
<!-- Footer --> | <!-- Footer --> | ||
<footer class="w3-center w3-green w3-padding-64 w3-opacity w3-hover-opacity-off"> | <footer class="w3-center w3-green w3-padding-64 w3-opacity w3-hover-opacity-off"> |
Latest revision as of 08:14, 17 October 2018
Improve
Overview