Line 7: | Line 7: | ||
<script> | <script> | ||
− | $( | + | <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> |
+ | <script> | ||
+ | $(document).ready(function(){ | ||
+ | // Add smooth scrolling to all links | ||
+ | $("a").on('click', function(event) { | ||
− | + | // Make sure this.hash has a value before overriding default behavior | |
+ | if (this.hash !== "") { | ||
+ | // Prevent default anchor click behavior | ||
+ | event.preventDefault(); | ||
− | + | // Store hash | |
− | + | var hash = this.hash; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | // Using jQuery's animate() method to add smooth page scroll | ||
+ | // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area | ||
+ | $('html, body').animate({ | ||
+ | scrollTop: $(hash).offset().top | ||
+ | }, 800, function(){ | ||
+ | |||
+ | // Add hash (#) to URL when done scrolling (default click behavior) | ||
+ | window.location.hash = hash; | ||
+ | }); | ||
+ | } // End if | ||
+ | }); | ||
}); | }); | ||
− | |||
− | |||
</script> | </script> | ||
Line 57: | Line 69: | ||
− | <a href="# | + | <a href="#section2"><img src="https://static.igem.org/mediawiki/2017/8/8c/T--William_and_Mary--arrowright.jpeg" height = "80"/></a> |
+ | <div class="main"> | ||
+ | <section></section> | ||
+ | </div> | ||
Line 72: | Line 87: | ||
</div> | </div> | ||
− | + | ||
− | + | ||
− | + | ||
<br> | <br> | ||
<br/> | <br/> | ||
+ | |||
+ | |||
+ | <div class="main" id="section2"> | ||
<center> | <center> | ||
− | < | + | <section><img src="https://static.igem.org/mediawiki/2017/d/de/T--William_and_Mary--greenyellowinfographic.jpeg" height = "2200"/></section> |
</center> | </center> | ||
</div> | </div> | ||
+ | |||
+ | |||
Revision as of 02:38, 5 October 2017