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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:25:41+00:00 2026-06-16T02:25:41+00:00

the JS : function imgLoader(imgObj) { alert(imgObj.id + : + imgObj.src + : +imgObj.width);

  • 0

the JS :

function imgLoader(imgObj)
         {
          alert(imgObj.id + " : " + imgObj.src + " : " +imgObj.width);
        }

the html :

<img id="img_1" src="image_1.png" onload="imgLoader(this)" />
<img id="img_2" src="image_2.png" onload="imgLoader(this)" />
<img id="img_3" src="image_3.png" onload="imgLoader(this)" />
<img id="img_4" src="image_4.png" onload="imgLoader(this)" />
<img id="img_5" src="image_5.png" onload="imgLoader(this)" />

related css (updated bc of css comment / question)

img {position:relative; height: 46px; display: inline-block; cursor:pointer; margin: 0px 10px 0px 0px; padding: 0px 10px 0px 10px;}

note there is no other css.
Problem : is it just friday and close to the holidays that I am missing something obvious ? the alerts from the onload all report the same value, however the same function when tied to a hover – accurately reports the width.

But when this runs at initial image load time, my alert box looks like (this is actually a fabricated order, since the order of which the images are loaded is not yet controlled and is up to the browser – but this illustrates my problem well enough) :

“img_1 : image_1.png : 125”

“img_2 : image_2.png : 125”

“img_3 : image_3.png : 125”

“img_4 : image_4.png : 125”

“img_5 : image_5.png : 125”

This is incredibly silly because the images vary from 15px to 400px in width. What gives?

  • 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-16T02:25:42+00:00Added an answer on June 16, 2026 at 2:25 am

    Your code working fine on mozilla firefox and IE 6

    <script type="text/javascript">
    <!--
    function imgLoader(imgObj)
             {
              alert(imgObj.id + " : " + imgObj.src + " : " +imgObj.width);
            }
    -->
    </script>
    
    
    <img id="img_1" src="image_1.png" onload="imgLoader(this)" />
    <img id="img_2" src="image_2.png" onload="imgLoader(this)" />
    <img id="img_3" src="image_3.png" onload="imgLoader(this)" />
    <img id="img_4" src="image_4.png" onload="imgLoader(this)" />
    <img id="img_5" src="image_5.png" onload="imgLoader(this)" />
    

    different width are shown on 5 alert boxes. in firefox it was fast and 5 alert boxes just showed so fastly one after another before clicking.so when all alert boxes are shown then the 5th alert box was on the top. then after clicking that the 4th appeared under that.

    didn’t find any problem. check your images if those are in different width or not.

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

Sidebar

Related Questions

I have the following code: $('#imageform').submit(function() { $(#imageBox).html(''); $(#imageBox).html('<img src=img/loader.gif alt=Uploading..../>'); $(#imageform).ajaxSubmit( { target:
function Apple(){ this.name=apple; } function Orange(){ this.name=orange; this.apple = new Apple(); this.apple.onCalled=function(){ alert(this.name); }
<div class=content id=current> <div id=loader style=display:none;><img src=/images/loader.gif alt= /></div> </div> I have this code.
function LolClass(){ this.init = function(){ button_a.bind(tap, function(){ this.refreshFields(); // doesn't work //refreshFields(); // doesn't
function Person() {} Person.prototype.population = 0; Person.prototype.constructor = function(name) { this.name = name; console.log(Name:
function getWindowsUserName() { var WinNetwork = new ActiveXObject(WScript.Network); var urlToSite = createCustomURL(WinNetwork.UserName); document.getElementById(psyncLink).src =
function getUser() { FB.api('/me', function(response) { console.log('Response is '+response); alert('Your name is ' +
function getDbValue() { alert($('[data-bind]').length); alert($('[data-bind][0].data-bind')); alert($('[data-bind][0].value')); jQuery.each($('[data-bind]'), function(databind,key) { alert(key); alert(databind); alert(databind[key].data-bind); }) }
Dreamweaver shows an error in the file jquery.jig.js the file is this jQuery(document).ready(function(){ $('#contactform').submit(function(){
How do you pass values from a link like this to a function <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.