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

  • Home
  • SEARCH
  • 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 8851081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:03:43+00:00 2026-06-14T13:03:43+00:00

I am having stripes for background image which is having both in-active and active

  • 0

I am having stripes for background image which is having both in-active and active image for list items. I want to slowly load the active class.

CSS EXAMPLE for one Span

.customer1 {    width: 105px; height:68px;  background:url(../img/in-customer1.png) 0px 15px  no-repeat;    display:block; }
.customer1_active {   background:url(../img//customer1_active.png) 0px -70px  no-repeat;  }

HTML

<div id="customers">
 <span class="customer1"></span> 
 <span class="customer2"></span>
  <span class="customer3"></span>
  <span class="customer4"></span> 
</div>

Tried so far

 $(this).removeClass('default').addClass('fixed').fadeIn('slow');

Please help how I can slowly load the active image on hover at spans

  • 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-06-14T13:03:44+00:00Added an answer on June 14, 2026 at 1:03 pm

    To answer your question, no you cannot “slowly” change a class, as web technology as of now does not support it [though it is possible with background image colors and css3, but that does not work with background-images]…

    However, to achieve the effect that you want [ie: A mouseover “hover” effect with background images], use the following method:

    Add an overlay-container “<div>” inside each of the <span> elements. Then position it absolute with css, add a background-image [which will be the hover image]. Make the div the same size as span, and add mouseover/mouseout handlers on the span tag, which should animate the opacity of the <div> inside it. So that the element responds to the “hover“.

    So with that, less talk and more code….

    HTML:

    <div id="customers">
     <span class="customer1"></span> 
    </div>​
    

    CSS:

    #customers span {   width: 105px; height:68px;  display:inline-block; }
    .customer1{
        background:url(http://placekitten.com/105/68) 0px 0px  no-repeat;
    }
    .customer1_active{
        background:rgba(0,0,0,0.7);
    }
    #customers .active {
    position:absolute;
    }​
    

    JS:

    $("#customers span").each(function(){
        $(this).append("<div></div>").find("div").attr("class",$(this).attr("class")+"_active active").css({height:$(this).css("height"),width:$(this).css("width"),opacity:0});
        $(this).hover(function(){$(this).find("div").clearQueue().animate({opacity:1})},function(){$(this).find("div").clearQueue().animate({opacity:0})})
        });​
    

    JSFiddle: http://jsfiddle.net/mGcjU/1/

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

Sidebar

Related Questions

Having trouble with each function... Will try to explain by example... In my code,
I currently have a site that uses a two-tone background image that is centered
I'm having an issue using Stripes validation method. It works but rather than returning
I want to avoid having to override each label provider. Is there a simpler
I am having a peculiar problem with the order in which FlowLayoutPanels are added
related question with unsatisfactory answers: Changing CSS Values with Javascript Here's what I want
I'm having trouble figuring out how to maintain my table stripes after adding new
I'm having some trouble getting Stripe up and running in my Rails app. When
Having searched a whole lot of similair posts, workarounds, I decided to make my
Having a hard time with labels on a ggplot2 plot. Here's a similar plot

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.