Chris Test 1

Benchmark created on


Description

just testing my JQ

Preparation HTML

<div class="fnz-outer">
                <div class="push"></div>
</div>
<div id="footer">
                <div class="footer_text">
                                <a id="showRiskLegalLink" href="#footer_risk_legal" class="infoheader">Important Information</a>
                                <div id="infodetail"><a name="footer_risk_legal"></a>
                                <p class="infoheader">Important Information</p>
                                <p>blah blah blah nabtrade is awesome</p>
                                </div>
                                <p>WealthHub Securities Limited. The information on this site is governed by Australian law and is subject to the 
                                <a href="$downloadCentreURL">nabtrade Client Agreement</a>
                                and 
                                <a href="#">disclaimer page</a>
                                <p class="inline_menu">&copy;2011 NAB. All rights reserved. 
                                                | <a href="#">About nabtrade</a>
                                                | <a href="$downloadCentreURL">Privacy Policy</a> 
                                                | <a href="$downloadCentreURL">Financial Services Guide</a> 
                                                | <a href="$sitemapURL">Sitemap</a> 
                                                | <a href="$contactusURL">Contact Us</a>
                                </p>
                </div>                   
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
My changes
var footerPos = function(){

    var $myFooter = $("#footer");
    var $myFooterText = $myFooter.children('.footer_text');     

    var currentFontSize = parseFloat($myFooterText.css('font-size'),11);
    var paddingBottom = 13;
    var paddingTop = 12;
    switch (Math.round(currentFontSize)) {
    case 10:paddingBottom = 13;paddingTop = 11;break;
    case 9:paddingBottom = 12;paddingTop = 13;break;
    default:paddingBottom = 13;paddingTop = 12;
    }
    var newLineHeight = (currentFontSize>=11 ? 5:4.5)+currentFontSize;
    $myFooter.('p').css('line-height',newLineHeight+'px');
    $myFooterText .css('padding-top',paddingTop+'px');
    $myFooterText .css('padding-bottom',paddingBottom+'px');
    $('.push').css('padding-top',paddingTop+'px');
    $('.push').css('padding-bottom',paddingBottom+'px');
    var fheight=$myFooter.outerHeight(true);
    $('.fnz-outer').css('margin-bottom',-1*fheight-1);
    $('.push').height($myFooterText.height());
    return false;
}       
ready
The original
var footerPos = function(){
    var currentFontSize = parseFloat($('#footer .footer_text').css('font-size'),11);
    var paddingBottom = 13;
    var paddingTop = 12;
    switch (Math.round(currentFontSize)) {
    case 10:paddingBottom = 13;paddingTop = 11;break;
    case 9:paddingBottom = 12;paddingTop = 13;break;
    default:paddingBottom = 13;paddingTop = 12;
    }
    var newLineHeight = (currentFontSize>=11 ? 5:4.5)+currentFontSize;
    $('#footer p').css('line-height',newLineHeight+'px');
    $('#footer .footer_text').css('padding-top',paddingTop+'px');
    $('#footer .footer_text').css('padding-bottom',paddingBottom+'px');
    $('.push').css('padding-top',paddingTop+'px');
    $('.push').css('padding-bottom',paddingBottom+'px');
    var fheight=$('#footer').outerHeight(true);
    $('.fnz-outer').css('margin-bottom',-1*fheight-1);
    $('.push').height($('#footer .footer_text').height());
    return false;
}       
    
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.