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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:01:44+00:00 2026-05-13T20:01:44+00:00

I have, what I think is, a strange issue. I am running a simple

  • 0

I have, what I think is, a strange issue. I am running a simple query that finds the largest image on a page. Here is some test data – all images are 32×32 but one is sized to 300×300.

<img src="app/assets/images/icons/blue.png" />
<img src="app/assets/images/icons/error.png"/>
<img src="app/assets/images/icons/info.png" height="300" width="300"/>

If I run a simple query like this:

$('img').each(function(){
        console.log($(this).height());
    });

I will get 0,0,300 — and not 32,32,300.

Can anyone point me to a better method of finding the size the image is being rendered at?

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-05-13T20:01:44+00:00Added an answer on May 13, 2026 at 8:01 pm

    If the image is “natively” sized, i.e. no width or height are present in the HTML, you’ll need to wait for the image to load before you know its size. I use this:

    jQuery("img").each(function(){
        var img = jQuery(this);
        if (img.attr("complete")) {
            console.log(img.height());
        } else {
            img.load(function(){
                console.log(img.height());
            });
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a strange issue that I think I have a workaround for, but
I have a strange issue that I am asked to make a Spring MVC
I have created a JSP test framework but running into this issue if I
Having a very strange issue regarding postback in ASP.NET. I have page dynamically populating
I have a fairly strange(IMO) issue here with a webservice provided by a third
This is a pretty strange issue, but I think it might be that I
Friends, I have a strange need and cannot think my way through the problem.
I have a kind of strange thing that I really nead for my text
I have the following query, now the strange thing is if I run this
We have come across a strange issue with ConcurrentHashMap , where two threads appears

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.