Grow your CSS skills. Land your dream job.

Anchor Link effect on mouse down

  • # August 3, 2011 at 12:00 pm

    In my nav bar, I’d like to have a mousedown effect on each button. I looked for a way with JavaScript (on google) but couldn’t find any that did what I wanted.
    Could somebody please post some code?

    (I would like the effect to be sort of like the Apple website)

    # August 3, 2011 at 12:25 pm

    you mean you want the buttons to change on hover on click and in the regular position?

    # August 3, 2011 at 12:31 pm

    The button changes on hover, and when active.
    I want it to change when the mouse button is pressed down. (onmousedown)

    Rob
    # August 3, 2011 at 12:35 pm

    Well you don’t need Javascript to do that…

    a:hover

    a:active

    in CSS will sort that out – you only need Javascript when you want to implement some sort of animation (without using CSS3)

    # August 3, 2011 at 12:44 pm

    Thanks. I’d been using divs within anchor links, but realised that I don’t need the divs anymore.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

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