Difference between revisions of "Team:Calgary/Layout"

Line 13: Line 13:
 
     <link rel="stylesheet" href="https://2018.igem.org/Team:Calgary/animation_css?action=raw&ctype=text/css">
 
     <link rel="stylesheet" href="https://2018.igem.org/Team:Calgary/animation_css?action=raw&ctype=text/css">
 
     <link rel="stylesheet" href="https://2018.igem.org/Team:Calgary/layout_css?action=raw&ctype=text/css">
 
     <link rel="stylesheet" href="https://2018.igem.org/Team:Calgary/layout_css?action=raw&ctype=text/css">
 +
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ"
 +
        crossorigin="anonymous">
 +
    <link rel="stylesheet" href="https://2018.igem.org/Team:Calgary/animation_css?action=raw&ctype=text/css">
 +
  <link rel="stylesheet" href="https://2018.igem.org/Team:Calgary/ProjectCSS_css?action=raw&ctype=text/css">
 
     <!-- JS -->
 
     <!-- JS -->
 
     <script src="https://2018.igem.org/Team:Calgary/jquery_3_3_1_min_js?action=raw&ctype=text/javascript"></script>
 
     <script src="https://2018.igem.org/Team:Calgary/jquery_3_3_1_min_js?action=raw&ctype=text/javascript"></script>
Line 26: Line 30:
 
             });
 
             });
 
         });
 
         });
 +
    window.onscroll = function() {scrollFunction()};
 +
 +
function scrollFunction() {
 +
    if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
 +
        document.getElementById("topBtn").style.display = "block";
 +
    } else {
 +
        document.getElementById("topBtn").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>
 
     </script>
 
     <script src="https://2018.igem.org/Team:Calgary/bootstrap_min_js?action=raw&ctype=text/javascript"></script>
 
     <script src="https://2018.igem.org/Team:Calgary/bootstrap_min_js?action=raw&ctype=text/javascript"></script>
Line 31: Line 51:
  
 
<body>
 
<body>
 +
    <button onclick="topFunction()" id="topBtn" title="Go to top">TOP</button>
 
     <!-- Header -->
 
     <!-- Header -->
 
     <nav class="navbar navbar-expand-lg navbar-light">
 
     <nav class="navbar navbar-expand-lg navbar-light">

Revision as of 06:33, 16 October 2018