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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:54:56+00:00 2026-05-25T18:54:56+00:00

I have a div using the following class: div.textStatement { height: 70px; overflow: hidden;

  • 0

I have a div using the following class:

div.textStatement
{
    height: 70px;
    overflow: hidden;
}

When the user clicks a link (‘Show More’), the div expands to show more text and the ‘overflow’ should get set to ‘scroll’ so that the user can read all the text, in the event there is more text than the height of the div will show. However, the reference to the ‘overflow’ property of the div is coming back ‘undefined’ so that I can’t set it to ‘scroll.’ Any idea why the ref to the div’s overflow is coming back ‘undefined’? I think that would fix the problem (and make the scrollbars show up).

Here’s the div:

<asp:Panel ID="textStatement" class="textStatement" runat="server"></asp:Panel>
<label id="candidateStatementShowMoreLess" class="MoreLess" onclick="ShowMoreLess(this)">Show More</label>

Here’s the javascript (using jQuery):

var IsStatementExpanded = false;
var IsDescriptionExpanded = false;

function ShowMoreLess(moreLessLink)
{
    var section = $(moreLessLink).prev("div");
    var sectionId = $(section).attr("id");
    var collapsedHeight = 70;
    var expandedHeight = 300;

    if (section.height() == collapsedHeight)
    {
        section.animate({ height: expandedHeight }, 500,
            function ()
            {
                $(moreLessLink).html("Show Less");

                // ***** This should be setting the overflow to scroll on the div, but isn't, as "attr" is coming back undefined. *****
                section.attr("overflow", "scroll");
            });

        if (sectionId == "textStatement")
        {
            IsStatementExpanded = true;
        }
        else if (sectionId == "textDescription")
        {
            IsDescriptionExpanded = true;
        }
    }
    else
    {
        section.animate({ height: collapsedHeight }, 500,
            function ()
            {
                $(moreLessLink).html("Show More");

                // ***** This could have the same problem as above, but when the user collapses the div. *****
                section.attr("overflow", "hidden");
            });

        if (sectionId == "textStatement")
        {
            IsStatementExpanded = false;
        }
        else if (sectionId == "textDescription")
        {
            IsDescriptionExpanded = false;
        }
    }
}
  • 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-25T18:54:56+00:00Added an answer on May 25, 2026 at 6:54 pm
    section.attr("overflow", "scroll");
    

    is incorrect. It needs to be

    section.css("overflow", "scroll");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a funciton that I am currently using to show a hidden div.a_type
I have a div with overflow:hidden , inside which I show a phone number
I have the following CSS class: .hidden { visibility: hidden; position: absolute; } I
I have following div: <div id = zone-2fPromotion-2f class = promotion> How can I
I am using a div with class scroll-pane (height 100%) within an absolute positioned
Hi guys lets say I have the following html: <div class=owner> <div> <a href=javascript:void(0)
I have a simple html page with a div. I am using jQuery to
I have three images and using the following code I have then fade in
Say I have 4 div elements with class .navlink , which, when clicked, use
I have a div and I am trying to add a CSS class to

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.