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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:00:24+00:00 2026-05-20T01:00:24+00:00

The problem behind my question in the title is this: jQuery( document ).ready( function()

  • 0

The problem behind my question in the title is this:

jQuery( document ).ready( function() {
    var height = jQuery( "#current-image" ).css( "height" ); // Retrieve height
    jQuery( '#prev' ).css( 'height', height + 'px' );        // Set element to that height
});

First I retrieve the height of the element “current-image”. Then I want to set that height to another element, called “prev”.

  • The element “prev”‘s default height is 200 px.
  • The element “current-image”‘s height is 350 px
  • I want the element “prev”s height to be 350 px

Somehow the element “prev” keeps it original height 200px. When I put an alert(height); statement between the two lines of code the variable is indeed 350 but it never sets the height of the “prev” element. I can’t figure out what I’m doing wrong since this is such an simple bit of code..

  • 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-20T01:00:24+00:00Added an answer on May 20, 2026 at 1:00 am

    height should contain “350px” and not “350” because you’re getting the CSS value for this element, not the computed height (without unit). So you don’t need to add + ‘px’, because you’ll obviously get “350pxpx” which is invvalid, hence the height not changing.

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

Sidebar

Related Questions

This is a question with no real problem behind, just a product of my
This is kind of I already lost x hours debugging this kind of problem/question
I am posting this question after reading other similar questions about my problem but
THis is a followup to my previous question Font-dependent control positioning. It's an attempt
Okay first let me tell you the story behind the question. We have a
I have a webapp written in PHP using a MySQL database backend. This question
I have question about the combo box. The problem I'm having is with the
this is my first question.. be gentle :) I am part of the development
So this question is (somewhat distantly) related to this previous question: Best way to
Problem: I have an address field from an Access database which has been converted

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.