Grow your CSS skills. Land your dream job.

NEED HELP WITH STATEMENTS

  • # June 23, 2013 at 9:56 pm

    Okay guys I have a big question. I am making a navigation menu that starts 300px from the top of the screen, when I click on a link in the navigation menu that navigation menu moves to the top of the screen when the new page loads. Now the menu sits at 0px. This is good, however when the menu is at the top of the screen if the user clicks on another link I do not want the navigation menu to go back down to 300px then move up to 0px again. Instead I would like the menu to stay at 0px.

    I assume I need an if statement saying something along the lines of :

    if(#MyNavigation == 0px){
    do nothing.
    }else if(#MyNavigation ==300px){
    run function(move);
    }

    Basically I do not want a div spasm everytime the link is clicked unless they go home which will bring the navigation down to 300px. To shortform this, if the navigation is at the top stay, if the navigation is at 300px move to the top.

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".