Grow your CSS skills. Land your dream job.

Help with else statement

  • # June 23, 2013 at 10:51 pm

    Hey guys I need some sort of else statement, basically if my navigation on page load sits at 0px I do not want to animate it.

    //If the main container sits at 300px.
    if($(“#MainContainer”).css(‘top’) == ‘300px’) {
    //Animate the main container to 0px.
    $(“#MainContainer”).animate({
    top:’0px’
    });
    //Change the height of the main container to 80px.
    $(“#MainContainer”).css(‘height’,’80px’);
    //Change the padding on the navigation lists to 29px.
    $(“.Navigation li”).css(‘padding-top’,’29px’);
    }

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".