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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:13:32+00:00 2026-05-31T18:13:32+00:00

here is the sample: http://jsfiddle.net/Zg55k/ How can I change css background image and color

  • 0

here is the sample: http://jsfiddle.net/Zg55k/

How can I change css background image and color smoothly with fade effect. When press background-image should fadeOut and background-color fadeIn in same time.

  • 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-31T18:13:33+00:00Added an answer on May 31, 2026 at 6:13 pm

    You should make 2 layers. The layer that you want to fade in must have a higher z-index (or places below the other layer in the code) and have opacity: 0;
    Then gradually change the opacity to 1, for exmaple with jQuery animate.

    HTML:

    <div class="box1">
        <div class="box2">
        </div>
    </div>
    

    CSS:

    .box1 {
        background-image: url(http://www.webdesign.org/img_articles/14881/site-background-pattern-07.jpg);
        width: 100px;
        height: 100px;
    }
    
    .box2 {
        height: 100px;
        width: 100px;
        background: #000000;
        opacity: 0;
    }
    

    JS:

    $('.box1').click(function(){
        $('.box2').animate({
            opacity: 1
        });
    });
    

    See jsFiddle:
    http://jsfiddle.net/Mikey/9D32K/

    You also may do

    <div class="box1"></div>
    <div class="box2"></div>
    

    But then you should position the boxes absolute.

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

Sidebar

Related Questions

Here's the sample/jsFiddle: http://jsfiddle.net/antonpug/ub7xW/ Basically, you can't see it in the jsFiddle, I don't
Here is a sample fiddle: http://jsfiddle.net/K2zyU/4/ The problem I am experiencing is that the
Here is sample code: http://jsfiddle.net/BSjGX/1/ <input id=testing /> $('#testing') .keydown(function(e){ if(e.keyCode==13) {return false;} })
Here's the sample: http://jsfiddle.net/HnQWU/ When items are removed from a category, and that category
Here is a sample http://jsfiddle.net/mUpjw/15/ I had JQuery 1.2 in some old code and
Here is my sample http://jsfiddle.net/RaQtg/4/ I want to redirect my page to another URL
I've got two tables Here's a jsfiddle sample http://jsfiddle.net/tiitremmel/zW7bX/ There's two tables and result
I'm using simple jcarousel here is ther code: http://jsfiddle.net/w6fLA/ I'm trying to show div
I was creating a simple accordion menu based on concept used in here http://jsfiddle.net/WMfsR/
I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It

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.