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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:15:38+00:00 2026-06-16T05:15:38+00:00

I’m pulling in some JSON content via an AJAX request, but when I try

  • 0

I’m pulling in some JSON content via an AJAX request, but when I try to append it to a nested div it does not scroll – the scrollbar appears but it’s inactive.

<style>
.tbox {
    width:440px;
    height: 500px;
    background-color:white;
    border:1px solid #E8E8E8;
    border-color:rgba(0,0,0,0.1);
    border-radius:5px;
    position:relative;
    -moz-box-shadow:3px 3px 14px #000;
    -webkit-box-shadow:3px 3px 14px #000;
    box-shadow:3px 3px 14px #000;
    margin:20px 0 0 50px;
    overflow: hidden;
}
.tbox .tbox-header {
    padding:12px;
    border-bottom:1px solid #E8E8E8;
    border-bottom-color:rgba(0,0,0,0.1);
    width: 100%;
    height: auto;
    overflow: hidden;
}
h1.ttitle {
    font-size:18px;
    line-height:18px;
    font-weight:bold;
}
.tbox .tbox-body {
    width: 100%;
    height: auto;
    overflow-x:hidden;
    overflow-y: scroll;
    position: relative;
}
ol {
    list-style-type:none;
    padding:2px;
}
ol li {
    clear:both;
    border-bottom:1px solid #E8E8E8;
    border-color:rgba(0,0,0,0.1);
    margin-bottom:15px;
    overflow:hidden;
    width:auto;
    height:auto;
}
</style>
<div class="tbox">
    <div class="tbox-header">
        <h1 class="ttitle">My Title</h1>
    </div>
    <div class="tbox-body">
        <ol>
        </ol>
    </div>
</div>

<script>
$.ajax({
    type: "GET",
    url: "[my PHP api]",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (data) {
        $.each(data, function (i, t) {
            $('.tbox-body ol').append(t.content);
        });
    }
});
</script>

If I delete the two nested classes (.tbox-header and .tbox-body) and append directly to .tbox it works fine, but when I try appending the content to the nested div .tbox-body the scrollbar is inactive. Changing the overflow-y options on .tbox to auto or scroll does not solve the issue.

  • 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-06-16T05:15:39+00:00Added an answer on June 16, 2026 at 5:15 am

    The problem you are having is that the tbox-body doesn’t know at what point it needs to scroll. The tbox is set to a fixed height of 500px. The easiest solution is to calculate the available height of the tbox-tbody and set it’s height in css.

    As a quick proof of concept, if you change the .tbox-tbody from:

    height:auto;
    

    to:

    height:300px;
    

    You should see that it now scrolls. Once you set a predetermined height on the tbox-tbody it also eliminates the need for the various overflow:hidden that you have on elements. You should only need to specify the overflow property on the tbox-tbody.

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

Sidebar

Related Questions

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 want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
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
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string

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.