Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3220554
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:46:30+00:00 2026-05-17T15:46:30+00:00

I am looking for a way to animate my sprites with jquery. When I

  • 0

I am looking for a way to animate my sprites with jquery. When I hover over the image, it fades in. then when I hover off. it fades out.

CSS:

nav ul { position: relative; z-index: 1000;  margin: -26px 0 0 11px; overflow: hidden; }
nav ul li { display: inline; }
nav ul li a { background: url(../images/nav-sprite.png); display: block; float: left; text-indent: -999px; margin: 0 auto; width: 667px; }
nav ul a#nav-1 { background-position: 0 0;  height: 48px; width: 103px; }
nav ul a#nav-2 { background-position: -103px 0;  height: 48px; width: 129px; }
nav ul a#nav-3 { background-position: -234px 0;  height: 48px; width: 156px; }
nav ul a#nav-4 { background-position: -392px 0;  height: 48px; width: 147px; }
nav ul a#nav-5 { background-position: -541px 0;  height: 48px; width: 124px; }
nav ul a#nav-1:hover { background-position: 0 48px; }
nav ul a#nav-2:hover { background-position: -103px 48px; }
nav ul a#nav-3:hover { background-position: -234px 48px; }
nav ul a#nav-4:hover { background-position: -392px 48px; }
nav ul a#nav-5:hover { background-position: -541px 48px; }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:46:30+00:00Added an answer on May 17, 2026 at 3:46 pm

    There’s nothing specific to sprites in this question. You can always use the usual method, combining the hover event with the fadeTo function to get the opacity animation you need.

    $("nav ul a").hover(function(){
        $(this).stop().fadeTo(300, 1);
    }, function(){
        $(this).stop().fadeTo(300, 0.4);
    }).fadeTo(0, 0.4);
    

    If you need to, you can also add a CSS fallback:

    nav ul a {
        opacity: 0.4;
    }
    
    nav ul a:hover {
        opacity: 1;
    }
    

    See it working live here: http://www.jsfiddle.net/yijiang/CNC6W/


    Well, it’s simple to fix – try adding a background to the ul element, then giving it a border-radius to make sure the rounded corners stay.

    nav ul {
        background: #000;
        -moz-border-radius: 8px;
        -webkit-border-radius: 8px;
        border-radius: 8px;   /* Not sure about the actual radius 
                                 you're using - these are guesses */
    }
    

    You might also want to increase the starting opacity from 0.4 to something higher, and the duration to something lower than 300.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I looking for way to animate text with jQuery. I want to display 'logging
I am looking for a way to animate a view transition when using the
I am using the jquery-ui-dialog plugin I am looking for way to refresh the
I'm trying to animate something using jQuery. UPDATE I have it working the way
I'm looking for a way to animate the drawing of a stroke with HTML
I was looking for a way to animate the scrolling of a ScrollViewer and
I'm looking for way to PHP to detect if a script was run from
I'm looking a way to enable IP logging with log4net in ASP.NET. I found
I'm looking for way to write Javascript programs / scripts on desktop, not inside
I'm looking a way to build conditional assignments in bash: In Java it looks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.