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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:01:22+00:00 2026-05-30T15:01:22+00:00

I have a slider which keeps animating the background images.The background images are being

  • 0

I have a slider which keeps animating the background images.The background images are being applied to the body element of the page i.e it takes the full size of the page.

This animation is seen on the home page… there are total 10 images in the slider which are fetched from the database.

My question is how should I preload these images since most of these images are more than 200-300KB in size.The jquery preload needs a static array of image names, but while loading I don’t knew their names.

So can you guys help me to preload these dynamic images?

  • 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-30T15:01:23+00:00Added an answer on May 30, 2026 at 3:01 pm

    Here is a simple script which helps to load images before hand using javascript.

        $.each(data, function(index, item) {
            var tempImage = new Image();
            tempImage.src = item.url;
            preloadedImages.push(tempImage);
        }
    
    
    where data as an array of image data 
    data=
    {
       name:'NameofImage',
       url:'http://www.website.com/image1.jpg',
    }
    

    To display the images you can simply add the images to the DOM

     $("img").attr({
                    src: item.src
                }).appendTo("#target");
    

    I have a simple jsfiddle which demonstartes the script. It takes data from an ajax request and pre-loads the images. When the user does a mouseover the target it attaches the image to the DOM.

    Below is the screenshot showing the images are being loaded at the time the page gets loaded:

    Net tab of firefox showing the images being preloaded

    this reference link argues that images loaded in div which are hidden might not be pre-loaded in some of the browsers like Opera. I thought haven’t verified it.

    There might be other ways to load images using css if you do not want to use javascript

    Hope this helps

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

Sidebar

Related Questions

I have a page which contains a jQuery-UI horizontal slider, created using a little
I have a slider which on page load should produce a value in the
I have to make a horizontal month slider which will have two pointers which
I'm working on http://lobounce.com.s138810.gridserver.com/ and have been having some problems with the slider which
At the moment I have a slider and an small input text box which
I have a div which displays the current value of the slider and the
I have an html page called search.html which contains sliders, they work perfectly in
I have a slider which includes 4 youtube videos that are embedded via the
I have a jquery slider which is working good in Firefox and Chrome. But
I have an Application which uses a Slider to show the progress of a

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.