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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:06:04+00:00 2026-05-20T00:06:04+00:00

I have an element that serves as the banner on my website. This banner

  • 0

I have an element that serves as the banner on my website. This banner has HTML content on it, but uses a high-resolution picture as the background-image. Because of this, I’m loading the background-image last and fading it in when it has been downloaded. My code looks like this:

<table id="bannerTable" border="0" cellpadding="0" cellspacing="0" style="width:640px; height:480px;">
  <tr><td style="padding-top:20px; padding-left:300px;">
    <div>[Some Text]</div>
  </td></tr>
  <tr><td style="vertical-align:bottom; padding-bottom:20px;">
    <div>[Site Menu Goes Here]</div>
  </td></tr>
</table>

  <script type="text/javascript">
    $(document).ready(function () {
      $("#bannerTable").loadBGImage("/picture1.png");
    });

    $.fn.loadBGImage = function (url) {
      var t = this;
      $('<img />')
        .attr('src', url)
        .load(function () {
          t.each(function () {
            $(this).hide();
            $(this).css('backgroundImage', 'url(' + url + ')');
            $(this).fadeIn();
          });
        });
      return this;
    }
  </script>

Even with this, my website feels static. Because of this, I want to loop through multiple high-resolution images at runtime. These high-resolution images will be used in the bannerTable as the background-image. I want them to fade-in and fade-out as they loop.

How do I do this with jQuery?

  • 1 1 Answer
  • 1 View
  • 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-20T00:06:05+00:00Added an answer on May 20, 2026 at 12:06 am
    • DEMO: http://so.devilmaycode.it/creating-a-jquery-slideshow-of-a-background-image

    look the demo source for the full working code

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

Sidebar

Related Questions

I have an element that has two classes but can't seem to select it
So I have an element that toggles between two background colours when clicked. But
I have an anchor element that looks like this <a href=url><img src=imgurl/>Text</a> I would
I have a block-level HTML element that contains multiple block-level and inline-level elements, e.g.
I have a <div> element that I want to dynamically add some HTML <a>
I have a TextBox input element that has a RequiredFieldValidator as such: <div> <label>First
I have a div that will serve as container to other element, I have
If have an element that maybe disabled on a page, and would like to
I have an element that can have multiple types (not my design). The element
I have an element that have items and a tag. The element can contain

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.