Team:WITS-CSIR SA/common.js

From 2011.igem.org

(Difference between revisions)
Line 15: Line 15:
   });
   });
-
   $('div.equalHeights').height(maxHeight + 50);
+
   $('div.' + c).height(maxHeight + 50);
}
}

Revision as of 11:37, 10 May 2011

function RebuildHeader() {

$('#p-logo').empty().append('

CSIR Wits

');
 $('#top-section').css({
   backgroundImage: 'url(https://static.igem.org/mediawiki/2011/5/53/Body_bg.gif)',
   backgroundColor: '#666666',
   backgroundRepeat: 'repeat-x',
   height: '155px'
 });

}

function SetEqualHeights(c){

 var maxHeight = 0;
 $('div.' + c).each(function(){
   maxHeight = Math.max($(this).height(), maxHeight);
 });
 $('div.' + c).height(maxHeight + 50);

}

function RemoveTitle(){

 $('.firstHeading').eq(0).remove();

}

function StyleBody(){

 $('body').addClass('ui-widget-content');
 $('#bodyContent, #content').css({
   backgroundColor: '#2e2e2e',
   backgroundImage: 'url(https://static.igem.org/mediawiki/2011/0/09/BackgroundBody.jpg)'
 });
 $('table').css('background-color', 'transparent');
 $('#catlinks').css({'background-color': 'transparent', border:'none'}).addClass('ui-widget-header ui-corner-all');
 var html = $('#footer-box').html();
 $('#footer-box').remove();
 $('#catlinks').html(html);
 $('body').css({ 'overflow-x': 'hidden', 'overflow-y': 'visible' });

}

$(function() {

 RebuildHeader();
 RemoveTitle();
 StyleBody();
 SetEqualHeights('equalHeights');
 SetEqualHeights('infoBox');

});