Template:Team:Calgary/Test
From 2013.igem.org
(Difference between revisions)
Line 34: | Line 34: | ||
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | ||
<script> | <script> | ||
- | |||
$(document).ready(function() { | $(document).ready(function() { | ||
+ | $('#slides').superslides({ | ||
+ | pagination: false, | ||
+ | animation: 'fade' | ||
+ | }); | ||
+ | |||
+ | NavSizing(); | ||
+ | DescriptionLinksSpacing(); | ||
+ | |||
+ | $(window).resize(function() { | ||
+ | NavSizing(); | ||
+ | DescriptionLinksSpacing(); | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | function NavSizing() { | ||
if ($('body').width() > 868) { | if ($('body').width() > 868) { | ||
$('#TopBar').css('padding-left', Math.floor(($('body').width() - 868) / 2)); | $('#TopBar').css('padding-left', Math.floor(($('body').width() - 868) / 2)); | ||
$('#LogoItem').css('display', 'block'); | $('#LogoItem').css('display', 'block'); | ||
} | } | ||
- | if | + | else if ($('body').width() <= 868) { |
- | if | + | if ($('body').width() > 744) { |
- | + | $('#TopBar').css('padding-left', Math.floor(($('body').width() - 744) / 2)); | |
- | + | $('#LogoItem').css('display', 'none'); | |
- | + | } | |
- | }); | + | } |
+ | } | ||
+ | |||
+ | function DescriptionLinksSpacing() { | ||
+ | var ScreenWidth = $('body').width(); | ||
+ | if (ScreenWidth > 1007) { | ||
+ | var Margins = Math.floor(ScreenWidth * .086666); | ||
+ | var ElementWidth = Math.floor(ScreenWidth * .37); | ||
+ | |||
+ | $('#SectionLinks').css('padding-left', Margins); | ||
+ | $('#SectionLinks').css('padding-top', Margins); | ||
+ | $('#SectionLinks .DescriptionLink').css('margin-right', Margins); | ||
+ | $('#SectionLinks .DescriptionLink').css('margin-bottom', Margins); | ||
+ | $('#SectionLinks .DescriptionLink').css('width', ElementWidth); | ||
+ | } | ||
+ | } | ||
</script> | </script> | ||
</head> | </head> | ||
</html | </html |
Revision as of 22:22, 13 August 2013