Line 1: | Line 1: | ||
− | + | ||
{{WLC-Milwaukee/header-js}} | {{WLC-Milwaukee/header-js}} | ||
<html lang="en"> | <html lang="en"> | ||
Line 7: | Line 7: | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link href="https://static.igem.org/mediawiki/2018/5/5b/T--WLC-Milwaukee--fonts.css.txt" rel="stylesheet"> | <link href="https://static.igem.org/mediawiki/2018/5/5b/T--WLC-Milwaukee--fonts.css.txt" rel="stylesheet"> | ||
− | + | {{WLC-Milwaukee/main-js}} | |
<link href="https://static.igem.org/mediawiki/2018/e/e3/T--WLC-Milwaukee--header.css.txt" rel="stylesheet"> | <link href="https://static.igem.org/mediawiki/2018/e/e3/T--WLC-Milwaukee--header.css.txt" rel="stylesheet"> | ||
<title>PLACEHOLDER</title> | <title>PLACEHOLDER</title> | ||
+ | |||
+ | <script> | ||
+ | $(function() | ||
+ | { | ||
+ | $(".hamburger").click(function() | ||
+ | { | ||
+ | $(".navigation").toggleClass("open"); | ||
+ | }); | ||
+ | |||
+ | $(".m-dropdown a").click(function(event) | ||
+ | { | ||
+ | var target = $(event.target); | ||
+ | if(!target.siblings().hasClass('show')) | ||
+ | { | ||
+ | $(".m-dropdown-content").removeClass('show'); | ||
+ | target.siblings().addClass('show'); | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | $(".m-dropdown-content").removeClass('show'); | ||
+ | } | ||
+ | |||
+ | }); | ||
+ | |||
+ | //Navbar Behavior | ||
+ | var prevScrollpos = window.pageYOffset; | ||
+ | window.onscroll = function() { | ||
+ | var currentScrollPos = window.pageYOffset; | ||
+ | if (prevScrollpos > currentScrollPos) { | ||
+ | document.getElementById("navbar").style.top = "0"; | ||
+ | $(".dropdown").removeClass("nomouse"); | ||
+ | if(!$(".dropdown").is(":visible")) | ||
+ | { | ||
+ | |||
+ | $(".navigation").show(); | ||
+ | } | ||
+ | else { $(".navigation").css("display", "");} | ||
+ | } else { | ||
+ | if($(".navigation").hasClass("open") && !$(".dropdown").is(":visible")){return;} | ||
+ | document.getElementById("navbar").style.top = "-60px"; | ||
+ | $(".dropdown").addClass("nomouse"); | ||
+ | $(".navigation").hide(); | ||
+ | |||
+ | if($(".dropdown").is(":visible")) | ||
+ | { | ||
+ | $(".navigation").css("display", ""); | ||
+ | } | ||
+ | |||
+ | } | ||
+ | prevScrollpos = currentScrollPos; | ||
+ | } | ||
+ | }); | ||
+ | </script> | ||
+ | |||
<!--HEADER STYLE--> | <!--HEADER STYLE--> | ||
<style> | <style> |
Revision as of 05:47, 13 October 2018
{{WLC-Milwaukee/main-js}}