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

  • Home
  • SEARCH
  • 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 140161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:33:54+00:00 2026-05-11T07:33:54+00:00

I’m working on a Facebook-like toolbar for my website. There’s a part of the

  • 0

I’m working on a Facebook-like toolbar for my website.

There’s a part of the toolbar where a user can click to see which favorite members of theirs are online.

I’m trying to figure out how to get the div element that pops up to grow based on the content that the AJAX call puts in there.

For example, when the user clicks ‘Favorites Online (4)’, I show the pop up div element with a fixed height and ‘Loading…’. Once the content loads, I’d like to size the height of the div element based on what content was returned.

I can do it by calculating the height of each element * the number of elements but that’s not very elegant at all.

Is there a way to do this with JavaScript or CSS? (note: using JQuery as well).

Thanks.

JavaScript:

    function favoritesOnlineClick() {     $('#favoritesOnlinePopUp').toggle();     $('#onlineStatusPopUp').hide();      if ($('#favoritesOnlinePopUp').css('display') == 'block') { loadFavoritesOnlineListing(); }  } 

CSS and HTML:

    #toolbar {     background:url('/_assets/img/toolbar.gif') repeat-x;     height:25px;     position:fixed;     bottom:0px;     width:100%;     left:0px;     z-index:100;     font-size:0.8em; } #toolbar #popUpTitleBar {     background:#606060;     height:18px;     border-bottom:1px solid #000000; } #toolbar #popUpTitle {     float:left;     padding-left:4px; } #toolbar #popUpAction {     float:right;     padding-right:4px; } #toolbar #popUpAction a {     color:#f0f0f0;     font-weight:bold;     text-decoration:none; } #toolbar #popUpLoading {     padding-top:6px; } #toolbar #favoritesOnline {     float:left;     height:21px;     width:160px;     padding-top:4px;     border-right:1px solid #606060;     text-align:center; } #toolbar #favoritesOnline .favoritesOnlineIcon {     padding-right:5px; } #toolbar #favoritesOnlinePopUp {     display:block;     border:1px solid #000000;     width:191px;     background:#2b2b2b;     float:left;     position:absolute;     left:-1px;     top:-501px; /*auto;*/     height:500px;/*auto;*/     overflow:auto; } #toolbar #favoritesOnlineListing {     font-size:12px; } <div id='toolbar'>     <div id='favoritesOnline' style=' <?php if ($onlinestatus == -1) { echo 'display:none;'; } ?> '>        <img class='favoritesOnlineIcon' src='/_assets/img/icons/favorite-small.gif' /><a href='javascript:favoritesOnlineClick();'>Favorites Online (<span id='favoritesOnlineCount'><?php echo $favonlinecount; ?></span>)</a>         <div id='favoritesOnlinePopUp'>             <div id='popUpTitleBar'>                 <div id='popUpTitle'>Favorites Online</div>                 <div id='popUpAction'><a href='javascript:closeFavoritesOnline();'>x</a></div>             </div>                  <div id='favoritesOnlineListing'>              <!-- Favorites online content goes here -->             </div>         </div>     </div> </div> 
  • 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. 2026-05-11T07:33:54+00:00Added an answer on May 11, 2026 at 7:33 am

    Maybe you could remove the height property (make sure it’s not set in the CSS) and let the DIV expand in height by itself.

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

Sidebar

Ask A Question

Stats

  • Questions 58k
  • Answers 58k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer The iPhone SDK does NOT give you direct access to… May 11, 2026 at 8:45 am
  • added an answer Check the instructions on how to use the --tunnel-user command… May 11, 2026 at 8:45 am
  • added an answer Another option, although it is a bit more work up… May 11, 2026 at 8:45 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

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.