treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Sliding Background Links

Last updated on:

$('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.

View Comments

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

Use markdown or basic HTML and be nice.