Difference between revisions of "Template:TP CC-SanDiego/navbar"
Rachellian7 (Talk | contribs) |
(Revert) |
||
Line 1: | Line 1: | ||
<html> | <html> | ||
+ | |||
<head> | <head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
− | + | <meta charset="utf-8" /> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'> | ||
+ | <link href='https://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'> | ||
+ | <link href='https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700' rel='stylesheet' type='text/css'> | ||
+ | |||
+ | <!-- Main stylesheet --> | ||
+ | <link rel="stylesheet" href="https://2015.igem.org/Team:TP_CC-SanDiego/navbar-CSS?action=raw&ctype=text/css" type="text/css"> | ||
+ | |||
+ | <!-- Window scroll + sidebar scroll JS --> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(window).scroll(function(){ | $(window).scroll(function(){ | ||
− | var winheight = | + | var winheight = $(window).height() - 416; |
var mn = $("#nav-wrapper"); | var mn = $("#nav-wrapper"); | ||
var mn2 = $("#nav"); | var mn2 = $("#nav"); | ||
− | var nextdiv = $("# | + | var nextdiv = $("#content-wrapper"); |
if($(window).scrollTop() > winheight){ | if($(window).scrollTop() > winheight){ | ||
mn.addClass("fixed"); | mn.addClass("fixed"); | ||
− | mn2. | + | mn2.addClass("marginRight") |
− | + | nextdiv.css("padding-top", "50px"); | |
− | nextdiv.css(" | + | |
} | } | ||
else{ | else{ | ||
mn.removeClass("fixed"); | mn.removeClass("fixed"); | ||
− | mn2. | + | mn2.removeClass("marginRight") |
− | + | nextdiv.css("padding-top", "0px"); | |
− | nextdiv.css(" | + | |
} | } | ||
}); | }); | ||
</script> | </script> | ||
+ | <script type="text/javascript"> | ||
+ | $(window).scroll(function(){ | ||
+ | var sbheight = $(window).height() - 416; | ||
+ | var sb = $("#sidebar") | ||
+ | // var nextdiv = $("#content-wrapper"); | ||
+ | if($(window).scrollTop() > sbheight){ | ||
+ | sb.addClass("sb-fixed"); | ||
+ | //nextdiv.css("padding-top", "50px"); | ||
+ | } | ||
+ | else{ | ||
+ | sb.removeClass("sb-fixed") | ||
+ | //nextdiv.css("padding-top", "0px"); | ||
+ | } | ||
+ | }); | ||
+ | </script> | ||
− | < | + | <script> |
− | + | $(function() { | |
− | + | $('a[href*=#]:not([href=#])').click(function() { | |
− | + | if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
− | + | var target = $(this.hash); | |
− | + | target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
− | + | if (target.length) { | |
− | + | $('html,body').animate({ | |
− | + | scrollTop: target.offset().top | |
− | + | }, 1000); | |
− | + | return false; | |
− | + | } | |
− | + | } | |
− | + | }); | |
− | + | }); | |
− | + | </script> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | } | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</head> | </head> | ||
− | |||
<body onload="setHeight()"> | <body onload="setHeight()"> | ||
− | |||
− | + | <div id="header-text"> | |
− | + | <h6>THE TEAM</h6> | |
− | </div> | + | </div> |
+ | <div id="whole-wrapper"> | ||
<div id="nav-wrapper"> | <div id="nav-wrapper"> | ||
<div id="nav"> | <div id="nav"> | ||
<span style="color: #f15258; border: 2px solid #f15258; padding: 5px 10px 5px 10px;">T P - C C</span> | <span style="color: #f15258; border: 2px solid #f15258; padding: 5px 10px 5px 10px;">T P - C C</span> | ||
<div id="nav-right"> | <div id="nav-right"> | ||
− | + | <a href="https://2015.igem.org/Team:TP_CC-SanDiego"> | |
− | + | HOME</a> | |
− | + | <a href="https://2015.igem.org/Team:TP_CC-SanDiego/Description"> | |
− | + | PROJECT</a> <!-- Overview, Experiments/Protocols, Safety, Results --> | |
− | + | <a href="https://2015.igem.org/Team:TP_CC-SanDiego/Notebook"> | |
− | + | NOTEBOOK</a> | |
− | + | <a href="https://2015.igem.org/Team:TP_CC-SanDiego/Practices"> | |
− | + | OUTREACH</a> <!-- Collaborations --> | |
− | + | <a href="https://2015.igem.org/Team:TP_CC-SanDiego/Team"> | |
− | + | TEAM</a> <!-- Attributions --> | |
</div> | </div> | ||
</div> | </div> |
Revision as of 23:28, 18 September 2015