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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:52:26+00:00 2026-06-01T14:52:26+00:00

I have an 10 images, each image represents digit 0-9 in a special font

  • 0

I have an 10 images,
each image represents digit 0-9 in a special font (thus the images)

in order to improve performance and delay, i pre-loaded the following images like the following:

 function createDigit() {
     for (var i = 0; i < 10; i++) {
         var obj = new Image;
         obj.src = 'digit' + i + '.png';
         digitHash[i] = obj;
     }
  }

so in digit hash, i have keys indexed from 0 to 9, and each corresponding value is the image object reference, which src is mapped to the image file location.

now in my html, i have a div tag

<div id='digits'></div>

now say i want to display ‘2000’
so i have the following jquery

$('#digits').append(dightHash[2], dightHash[0], dightHash[0], dightHash[0]);

it only displays ’20’
After some debugging and printing in firefox console, i notice that it happens when you are appending the SAME image reference more than once!
in other words, the second zero and third zero in ‘2000’ are not appended and thus we only have ’20’

if i append the following:

$('#digits').append(dightHash[2], dightHash[3], dightHash[4], dightHash[5]);

i get the full display of ‘2345’, becauase there is no duplicate image reference in append

How can I resolve this issue?
is there any other than append method of jquery i can use??

Thanks

  • 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-06-01T14:52:27+00:00Added an answer on June 1, 2026 at 2:52 pm

    Yes, append actually move around your DOM, instead of automatically making copies of the object you are appending.

    You can call .clone() so that appends take the copy of your image and append it instead of moving around the ref

    $('#digits').append(dightHash[2], $(dightHash[0]).clone(), $(dightHash[0]).clone(), $(dightHash[0]).clone());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 25 2D images (of equal size), each image represents one layer equally
I have a DataGrid that represents layers - each row is an image on
I have a set of jpeg images where each image has an associated description.
I have a form with number of submit type as images. Each image has
I have a image folder which contains sub directory for each album of images
I have a large (~2.5M records) data base of image metadata. Each record represents
That's pretty much what I am trying to accomplish. To have each image appear
I have 18 images that gets displayed like 6 images in each row. I
We have a MKmapView with a bunch of Image Annotation where each Image annotation
I have two models, Image and Tag . Each Image object can have more

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.