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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:10:43+00:00 2026-05-26T15:10:43+00:00

I have problem with preloading images. for(y=0;slide_image.lenght;y++){ for(x=0;slide_image[y].lenght;x++){ var preload_image=new Image(); preload_image.src=slide_image[y][x];} } When

  • 0

I have problem with preloading images.

for(y=0;slide_image.lenght;y++){
   for(x=0;slide_image[y].lenght;x++){
      var preload_image=new Image();
      preload_image.src=slide_image[y][x];}
}

When I do it only with preload_image.src=slide_image[x]; it works, but when i have these two it doesn’t. Maybe it’s JavaScript bug?

Here is slide_image array:

var slide_image = new Array();

slide_image = [
    ['1/1.png', '1/2.jpg', '1/3.jpg', '1/4.jpg', '1/5.png'],
    ['2/text_1.png', '2/1.jpg', '2/2.jpg', '2/3.jpg', '2/4.jpg', '2/5.jpg', '2/6.jpg', '2/7.jpg'],
    ['3/1.jpg', '3/2.jpg', '3/3.jpg', '3/4.jpg', '3/5.jpg', '3/6.jpg']
];

Firebug and Firefox debugger says nothing. I don’t know why this won’t work.

  • 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-26T15:10:44+00:00Added an answer on May 26, 2026 at 3:10 pm

    You typo’d length and you are using for loops incorrectly. The middle “argument” to the loop should be a conditional expression which will determine when your loop stops.

    Rewriting length and looping until your loop counters are less than the array’s length, you get:

    
    for (y = 0; y &lt slide_image.length; y++) {
        for (x = 0; x &lt slide_image[y].length; x++) {
            var preload_image = new Image();
            preload_image.src = slide_image[y][x];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a preloading image javascript script: function MM_preloadImages() { var d =
i have a very interesting problem. background i've used TTreeView for years but only
I have the following simple preloading function which substitute an image src attribute with
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I'm building an application that is an image gallery but with lots of images
I have a strange problem using a MapView in Android. It works fine until
I have a problem: after enable button, it look like enabled but isn't clickable.
Edit: I have a multiple image preloading script that I'm having problems with on
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names

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.