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 477127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:33:35+00:00 2026-05-13T00:33:35+00:00

I am building a website with hover effects. See http://vitaminjdesign.com/index.html and look at the

  • 0

I am building a website with hover effects. See http://vitaminjdesign.com/index.html and look at the services section in the bottom right. I am using :hover to change the background color. I want to use jquery to acheive the same result with an elegant fade. Here is my html:

<div class="iconrow">
   <a href="#"><img src="images/icon1.png" border="0" width="35" />
   <h2>Website Design</h2></a>
</div>

(repeated 6 times with different images and text)

Basically, when .iconrow is rolled over, I want the background to change from none to background-color: #cccccc; and when it is rolled off, back to none.

  • 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-13T00:33:35+00:00Added an answer on May 13, 2026 at 12:33 am

    Note: I built and tested my solution via Firebug to work on the link you provided. If you follow these steps in order, you should have it fully working

    You will not be able to animate from transparent to a color except in Safari and Firefox 3.5 and other browsers that support RGBA background colors. If you are looking for a cross browser support, then I would attack the problem like this:

    1. Have your default hover effects scoped by a non-js class, so the :hover effects will work as a fall-back. A great way to do this is as follows:

    <html class="no-js">
       <head>
         .... meta, title, link tags ...
         <script type="text/javascript">document.documentElement.className = "js";</script>
         .... other scripts ...
       </head>
    

    This changes no-js to js before the page even displays.

    2. Use jQuery to add dummy elements along side your a tags (js to add the dummy element is in step 3)

    Here is the CSS to use:

    .js .iconrow { background: none !important } /* Hide current hover effect */
    
    .iconfader {
      position: absolute;
      display: block;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      -webkit-border-radius: 10px;
      -moz-border-radius: 10px;
      background-color: #ccc;
      z-index: 5;
    }
    
    .iconrow { position: relative } /* Spans are absolute, need the parent to be relative */
    .iconrow a { position: relative; z-index: 10} /* Needs to sit on top */
    

    3. Fade in and out the new dummy element on mouseenter and mouseleave

    $('.iconrow').each(function(){
       var $span = $("<span class='iconfader'></span>").css('opacity',0.0).appendTo(this);
       $(this).hover(function(){
           $span.stop().animate({opacity: 0.8}, 200);
       }, function(){
           $span.stop().animate({opacity: 0.0}, 200);
       });
    });
    

    Finally, be careful if you decide to use an image background instead of the solid color. IE7 and IE8 cannot alter the opacity of 24bit PNG files. It completely screws up the transparency.

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

Sidebar

Related Questions

Right now I'm building a website. Here's the link: http://theoew.uuuq.com/home/ This probably won't make
I have set up infinite scroll on a website I am building here: http://richardgordoncook.com/fg/
My website ( http://amosjackson.com/index ) has scroll navigation where you click on navigation links
I'm building a website using Twitter's Bootstrap.css. It comes with some helpful preset html/css
Here is the website I am talking about: http://benjaminpotter.org/clients/c3carlingford/ So I am building a
Building a website that has English & Japanese speaking users, with the Japanese users
I'm building a website that will send an email notification when certain actions are
Hello I am building a website using JSF 2.0. I am trying to set
I am building a website with a second level navigation with a fair whack
I'm building a website that requires very basic markup capabilities. I can't use any

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.