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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:24:52+00:00 2026-05-23T22:24:52+00:00

I am somewhat new to Jquery but I feel complete failure here at not

  • 0

I am somewhat new to Jquery but I feel complete failure here at not being able to do this. I’m sure its something stupid but I have been at this for far too long.

So if I have html as such…

<div class="lightbox-image">
    <img src="http://staging.greencupboards.com/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/feeds/MrsMeyers/MRM-64558.jpg" /> 
</div>

Why does this in my Jquery file generate a ‘null’ in the alert box?

alert($('.lightbox-image img'));

Shouldn’t the alert box have something in it such as ‘object’?

I have been on Jsfiddle and it still doesn’t work. I know I am missing something stupid so I apologize in advance for my naivety. Thanks a lot!

  • Nate

EDIT:

alert($('.lightboximage img'));
alert($('.lightboximage img').width());
$('.lightboximage img').load(function() {
    alert( $(this).width() );
});

This code generates an object on the first alert and a 0 on the next two alerts. Why is this? I know the image exists and JSfiddle says that its width is 825…

  • 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-23T22:24:53+00:00Added an answer on May 23, 2026 at 10:24 pm
    $('.lightboximage img').width(100);
    

    This works for me… I did notice that your image wasnt properly being retrieved from the server (401)

    http://jsfiddle.net/uuuwU/

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

Sidebar

Related Questions

I am somewhat new to jQuery and I have a problem with something I
I'm somewhat new to JavaScript/jQuery, but when I saw examples of method chaining it
I am somewhat new to jQuery but have been having fun trying learn about
I am somewhat new to jquery and have no idea if this is possible,
Being somewhat new to search engines, the notions of indexes and types are not
I'm somewhat new to Ajax/Jquery, so I apologize if this is an easy question,
I am having some trouble setting up FancyBox, I am somewhat new to jQuery.
I am somewhat new to R, and i have this piece of code which
I'm somewhat new at C++ (I normally work in C#, but right now I'm
I'm somewhat new to jQuery and am just wondering how I go about passing

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.