Team:Calgary/TestPageJS

From 2013.igem.org

Revision as of 21:49, 25 July 2013 by Wkeithvan (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

$(document).ready(function() { $('#slides').superslides({ pagination: false, animation: 'fade' });

NavSizing(); DescriptionLinksSpacing();

$(window).resize(function() { NavSizing(); DescriptionLinksSpacing(); }); });

function NavSizing() { if ($('body').width() > 868) { $('#TopBar').css('padding-left', Math.floor(($('body').width() - 868) / 2)); $('#LogoItem').css('display', 'block') } else if (($('body').width() <= 868) && ($('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); } }