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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:53:42+00:00 2026-05-30T11:53:42+00:00

I’m developing a site and fairly new to jquery. For some reason, when I

  • 0

I’m developing a site and fairly new to jquery. For some reason, when I use the .css() function on one div, it won’t change the height. It works on another div but not this one. Here is a link to the website:

http://dev.djrefine.com/epic/index111.html

To activate the function in question, open any article by clicking a grey box, then click the white “close” box in the top right corner.

and the code in question is on line 506 which is the sixth line in this snippet:

        var $wWidth = $(window).width();
        var $wHeight = $(window).height();

        var $newheight = Math.round($wHeight * 0.8 - 200) + 'px';

        $('#container').css('height',$newheight);

        $('#theThing').html($newheight);
        $('#thisThing').html($('#container').css('height'));

        $('#makeMeScrollable').css({'height':$wHeight * 0.8 - 200,'width':$wWidth - 260});

the div #makeMeScrollable is correctly adjusting its css, but the #container div is not.

The div #theThing and #thisThing are just showing that the $newheight is the correct number, but the container height is not being set to equal that number, as you can see in the demo page

also I’ve tried to have $newheight not rounding, not adding ‘px’ on the end, and every other variation I could think of…

  • 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-30T11:53:44+00:00Added an answer on May 30, 2026 at 11:53 am

    Found a fix..

        setTimeout(function(){
            $('#container').css('height',$newheight);
            $('#thisThing').html($('#container').css('height'));
            $container.isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' });
            $container.isotope( 'reLayout' );
            }, 0);
    

    thanks goes to Alex Sexton’s answer at this post:

    recalculate element height in jQuery after class change

    It basically delays the stuff in the timeout 0 seconds, but having it there forces them to wait until the rest of the function is finished. I don’t know WHY it’s necessary, but it worked.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I want use html5's new tag to play a wav file (currently only supported
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a French site that I want to parse, but am running into

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.