Template:Team:Calgary/Main
From 2013.igem.org
(Difference between revisions)
Line 31: | Line 31: | ||
<!-- JavaScript and JQuery --> | <!-- JavaScript and JQuery --> | ||
<script> | <script> | ||
- | + | $(document).ready(function() { | |
- | + | $('#Banner').css('display', 'block'); | |
- | + | $('#Page').css({'position' : 'relative', top : '19px'}); | |
- | + | $('#TopBar').css('position', 'static'); | |
- | + | $('#Content').css('top', '0'); | |
- | $('# | + | |
- | + | if (window.pageYOffset < 180) { | |
- | + | $('#TopBar').css('position', 'static'); | |
- | + | } | |
- | + | else { | |
- | + | $('#TopBar').css('position', 'fixed'); | |
- | $( | + | } |
+ | |||
+ | $(window).scroll(function() { | ||
+ | if(window.pageYOffset < 180) { | ||
+ | $('#TopBar').css('position', 'static'); | ||
+ | $('#Content').css('top', '0'); | ||
+ | } | ||
+ | else { | ||
+ | $('#TopBar').css('position', 'fixed'); | ||
+ | $('#Content').css('top', '94px'); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
+ | <script> | ||
+ | $(document).ready(function() { | ||
+ | $('a[href^="http://"]').not('[href*="Team:Calgary"]').attr('target', '_blank'); | ||
+ | $('a[href^="https://"]').not('[href*="Team:Calgary"]').attr('target', '_blank'); | ||
+ | |||
if ($('body').width() > 868) { | if ($('body').width() > 868) { | ||
$('#LogoItem').css('display', 'block'); | $('#LogoItem').css('display', 'block'); | ||
Line 49: | Line 67: | ||
$('#LogoItem').css('display', 'none'); | $('#LogoItem').css('display', 'none'); | ||
} | } | ||
+ | |||
+ | $(window).resize(function() { | ||
+ | if ($('body').width() > 868) { | ||
+ | $('#LogoItem').css('display', 'block'); | ||
+ | } | ||
+ | else if ($('body').width() <= 868) { | ||
+ | $('#LogoItem').css('display', 'none'); | ||
+ | } | ||
+ | }); | ||
}); | }); | ||
- | |||
</script> | </script> | ||
</head> | </head> |
Revision as of 05:43, 24 September 2013