|
|
Line 1,230: |
Line 1,230: |
| } | | } |
| | | |
− | .top_button{
| |
− | width: 5%;
| |
− | cursor: pointer;
| |
− | position: fixed;
| |
− | right: 2%;
| |
− | bottom: 30px;
| |
− | display: none;
| |
− | transition-duration: 0.4s;
| |
− | }
| |
| | | |
− | .top_button:hover{
| |
− | transform: scale(1.2);
| |
− | }
| |
| | | |
| | | |
Line 1,617: |
Line 1,605: |
| </div> | | </div> |
| </div> | | </div> |
− | <img class="top_button" id="tb" src="https://static.igem.org/mediawiki/2018/e/e8/T--NCTU_Formosa--top.png">
| + | |
| </body> | | </body> |
| | | |
Line 1,698: |
Line 1,686: |
| </script> | | </script> |
| | | |
− | <script type="text/javascript" src="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js"></script>
| |
− | <script>
| |
− | $(function(){
| |
− | $('.top_button').click(function(){
| |
− | $('html, body').animate({
| |
− | scrollTop: 0
| |
− | }, 1500, "easeOutCirc");
| |
− | return false;
| |
− | });
| |
− | });
| |
| | | |
− |
| |
− | window.onscroll = function() {
| |
− | var box = document.getElementById('tb');
| |
− | var osTop = document.documentElement.scrollTop || document.body.scrollTop;
| |
− | // console.log(osTop)
| |
− | if (osTop>700) {
| |
− | box.style.display = "block"
| |
− | }
| |
− | if (osTop<200) {
| |
− | box.style.display = "none"
| |
− | }
| |
− | }
| |
− |
| |
− | </script>
| |
| </html> | | </html> |