Team:WITS-CSIR SA/common.js

From 2011.igem.org

(Difference between revisions)
Line 1: Line 1:
 +
jQuery.fn.extend
 +
({
 +
    removeCss: function(cssName) {
 +
        return this.each(function() {
 +
            var curDom = $(this);
 +
            jQuery.grep(cssName.split(","),
 +
                    function(cssToBeRemoved) {
 +
                        curDom.css(cssToBeRemoved, '');
 +
                    });
 +
            return curDom;
 +
        });
 +
    }
 +
});
 +
function ResizeLayout() {
function ResizeLayout() {
   $('#top-section, #content').css({
   $('#top-section, #content').css({
Line 23: Line 37:
   $('#bodyContent, #content').css('background-color', '#666666');
   $('#bodyContent, #content').css('background-color', '#666666');
   $('table').css('background-color', 'transparent');
   $('table').css('background-color', 'transparent');
-
   $('#footer-box, #catlinks').css({'background-color': 'transparent', border:'none', width:''}).addClass('ui-widget-header ui-corner-all');
+
   $('#footer-box, #catlinks').removeCss('width').css({'background-color': 'transparent', border:'none'}).addClass('ui-widget-header ui-corner-all');
}
}

Revision as of 12:40, 8 May 2011

jQuery.fn.extend ({

   removeCss: function(cssName) {
       return this.each(function() {
           var curDom = $(this);
           jQuery.grep(cssName.split(","),
                   function(cssToBeRemoved) {
                       curDom.css(cssToBeRemoved, );
                   });
           return curDom;
       });
   }

});

function ResizeLayout() {

 $('#top-section, #content').css({
   width: '100%'
 });

}

function RebuildHeader() {

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

}

function RemoveTitle(){

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

}

function StyleBody(){

 $('body').addClass('ui-widget-content');
 $('#bodyContent, #content').css('background-color', '#666666');
 $('table').css('background-color', 'transparent');
 $('#footer-box, #catlinks').removeCss('width').css({'background-color': 'transparent', border:'none'}).addClass('ui-widget-header ui-corner-all');

}

$(function() {

 ResizeLayout();
 RebuildHeader();
 RemoveTitle();
 StyleBody();

});