Difference between revisions of "Team:TUDelft/Header"

Line 5: Line 5:
 
         <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
 
         <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  
        <script>
 
            $(document).ready(function() {
 
                $("#HQ_page").removeAttr('id');
 
                $("#globalWrapper").removeAttr('id');
 
                $("#content").removeAttr('id');
 
                $("#bodyContent").removeAttr('id');
 
                $("#mw-content-text").removeAttr('id');
 
            });
 
 
        </script>
 
 
         <style>
 
         <style>
 
             /*  om MediaWiki style weg te halen*/
 
             /*  om MediaWiki style weg te halen*/
Line 159: Line 149:
  
 
         </div>
 
         </div>
 
        <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; // For Safari
 
                document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
 
            }
 
            //            <!-- hamburger -->
 
            function myFunction() {
 
                var x = document.getElementById("myTopnav");
 
                if (x.className === "navbartu") {
 
                    x.className += " responsive";
 
                } else {
 
                    x.className = "navbartu";
 
                }
 
            }
 
     
 
$(document).ready(function(){
 
            // Add smooth scrolling to all links
 
            $(".jump").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;
 
                        // Add hash (#) to URL when done scrolling (default click behavior)
 
                        window.location.hash = hash;
 
                    // Using jQuery's animate() method to add smooth page scroll
 
                    // The optional number (100) specifies the number of milliseconds it takes to scroll to the specified area
 
                    $('html, body').animate({
 
                        scrollTop: $(hash).offset() .top -100
 
                    }, 200, function(){
 
 
                    });
 
                } // End if
 
            });
 
        });
 
 
        </script>
 
  
 
     </body>
 
     </body>
  
 
</html>
 
</html>

Revision as of 17:21, 21 October 2019