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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:34:48+00:00 2026-05-23T14:34:48+00:00

I want to fade in a CSS page background image with jQuery when my

  • 0

I want to fade in a CSS page background image with jQuery when my page loads. I know it is possible to set a CSS page background image with jQuery and it is also possible to fade in text when a page loads but I am not sure how to do both.

You can set a CSS background image in jQuery by doing:

showBackground($("body").css({"background-image":"url(yourimage.jpg)"}));

You can fade in text by doing:

$(document).ready(function(){
            $('#fade').hide();
            $('#fade').append('This text should fade in.');
            $('#fade').fadeIn();
});
  • 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-23T14:34:49+00:00Added an answer on May 23, 2026 at 2:34 pm

    You can load the body background image on page load but to fade it you need to use some other manipulation like putting a div with 100% height-width to hold background image. I have tried following and it fades in both text and background (in div).

    <html>
    <head>
        <script type="text/javascript" 
          src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
        </script>
    </head>
    <body>
    <div id="b" style="display:none;left:0;top:0;margin:0;padding:0;width:100% 
         !important; height:100% !important;
          background-image:url('DSC00667.jpg');z-index:-1000;">
    </div>
    <div style="top:0;left:0;position:absolute;">
        <div id="d" style="height:200px;width:500px;margin:0 auto;top:0;
            clear:none;z-index:100;">
            this is text div that will fade in.
        </div>
        <div style="clear:both;height:1px !important;">&nbsp;</div>
    </div>
    <script type="text/javascript">
        $(function(){
            $("#b").fadeIn();
            $('#d').hide().append('This text should fade in.').fadeIn();
        });
    </script>
    </body>
    </html>
    

    fewer style elements may also work but I have not tested.

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

Sidebar

Related Questions

I want to fade in text when loading a page, w/ the background-color slowly
I have an image that I want to fade in once the page loads.
I look around to learn how to fade a background color using jquery, but
I want to fade in / fade out the row background color css when
I have to make something like an accordion, but I want it to fade
I found this content expand/collapse jQuery plugin. I want to add fade-in effect to
Hi guys I want to create an intro image (fade in and fade out
There was a fade out sample in the internet.. http://docs.dojocampus.org/dojo/fadeOut?t=tundra but i want to
I have a title text, which I want to fade into a box. Afterwards,
I have a jQuery UI tab control in my web page, and i want

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.