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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:10:58+00:00 2026-05-17T21:10:58+00:00

I have the following simple preloading function which substitute an image src attribute with

  • 0

I have the following simple preloading function which substitute an image “src” attribute with another image (an animated GIF “Loading”). The problem arises only in IE: if the “loading” GIF is smaller than the actual image src, that will be resized. For example if I have a square 100px image and preload it, the image is temporarly substituted by an animated GIF of 50x50px. Whem the original image is fully loaded it is NOT displayed at its size, but at the smaller 50px. Here is the code, if you need it

_preload = function(url, placeholderUrl) {
 var img = new Image();
 loading = true;
 var placeholder = new Element("img", {
  src: placeholderUrl
 });
 img.placeholder = placeholder;
 img.onload = function(evt) {
  this.placeholder.src = this.src;
  loading = false;
 }
 img.src = url;
 return placeholder;
}

alt text
Here you can see the visual error

  • 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-17T21:10:59+00:00Added an answer on May 17, 2026 at 9:10 pm

    You should be able to adjust the width/height of the image within the callback function:

    img.onload = function(evt) {
      this.placeholder.src = this.src;
      this.placeholder.width = this.width;
      this.placeholder.height = this.height;
      loading = false;
    }
    

    Example: Resizing image onLoad

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

Sidebar

Related Questions

I have the following simple button with an image as the template. The problem
I have the following simple function: private void EnableDisable941ScheduleBButton() { if (this._uosDepositorFrequency.Value != null)
I have the following simple javascript function to slide an object up and down.
I have the following simple script to test the mkdir() function in PHP: <?php
I have the following simple code : HTML: <div> <img src='http://i51.tinypic.com/4kz4g5.jpg' /> </div> CSS:
I have the following simple javascript code, which handles the Return Key, I don't
I have the following simple jQuery: $('#features').hide(); $('#more').click(function(e) { e.preventDefault(); $('#more').hide(); $('#features').show(); }); This
I have the following simple mysqli php application, which should work fine. $pk is
I have following simple piece of code, which is a part of ipv6 handling
I have the following simple TextBox subclass , which adds one dependency property (OutputIndex):

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.