Template:Templates/head
From 2014.igem.org
(Difference between revisions)
(11 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
<head> | <head> | ||
+ | <!-- found it --> | ||
<!-- Bootstrap --> | <!-- Bootstrap --> | ||
<!-- Latest compiled and minified CSS --> | <!-- Latest compiled and minified CSS --> | ||
Line 19: | Line 20: | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | ||
+ | <script type="text/javascript"> | ||
+ | $(document).ready(function() { | ||
+ | resizeBg(); | ||
+ | var navOffset = $('nav').offset().top; | ||
+ | window.addEventListener('resize', resizeBg, false); | ||
+ | $(window).scroll(function() { | ||
+ | stickyNav(); | ||
+ | }); | ||
+ | |||
+ | function stickyNav() { | ||
+ | if ($(window).scrollTop() >= navOffset) { | ||
+ | $('nav').css({ | ||
+ | 'position' : 'fixed', | ||
+ | 'top' : '0px' | ||
+ | }); | ||
+ | } else { | ||
+ | $('nav').css({ | ||
+ | 'position' : 'absolute', | ||
+ | 'top' : 'auto' | ||
+ | }); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function resizeBg(){ | ||
+ | var splash = $('#splash-wrapper'); | ||
+ | if(splash.width <= 1040 || window.innerHeight > window.innerWidth) { | ||
+ | splash.height(Math.floor(splash.width() / 1.6) -20); | ||
+ | } | ||
+ | |||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | </script> | ||
Latest revision as of 05:36, 6 August 2015