Grow your CSS skills. Land your dream job.

Last updated on:

Sliding Background Links

$('a', '#nav').hover(function() {
         if(!$(this).parent().hasClass('current')) {
                 $(this).stop().animate({
                         backgroundPosition: '(0 -75px)'
                 });
         }
 }, function() {
         if(!$(this).parent().hasClass('current')) {
                 $(this).stop().animate({
                         backgroundPosition: '(0 -0)'
                 });
         }
 });

Slides up and down the background image of a link when rolled over. Requires background position plugin.

Comments

  1. this is amazing.thanks for sharing

  2. Steven Braun
    Permalink to comment#

    The reference url has gone 404 on September 28, 2010.

Leave a Comment

Current day month ye@r *

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