Template:Templates/head

From 2014.igem.org

(Difference between revisions)
(Created page with "<!-- Bootstrap --> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optio...")
 
(14 intermediate revisions not shown)
Line 1: Line 1:
 +
<html>
 +
<head>
 +
          <!-- found it -->
<!-- Bootstrap -->
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<!-- Latest compiled and minified CSS -->
Line 17: 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>
Line 31: Line 68:
                 <script src="https://2014.igem.org/wiki/index.php?title=Team:Toronto/scripts/main&action=raw&ctype=text/js"></script>
                 <script src="https://2014.igem.org/wiki/index.php?title=Team:Toronto/scripts/main&action=raw&ctype=text/js"></script>
<script src="https://2014.igem.org/wiki/index.php?title=Team:Toronto/scripts/stickynav&action=raw&ctype=text/js"></script>
<script src="https://2014.igem.org/wiki/index.php?title=Team:Toronto/scripts/stickynav&action=raw&ctype=text/js"></script>
 +
</head>

Latest revision as of 05:36, 6 August 2015