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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:38:03+00:00 2026-06-13T22:38:03+00:00

I have a JQuery accordion where there is a possibility that text in the

  • 0

I have a JQuery accordion where there is a possibility that text in the title section can be very long.

<div id="accordion">
    <h3><a href="#">Title 1</a></h3>
    <div>
        Content 1
    </div>
    <h3><a href="#">Title 2 is really really long. Ideally, only a part of title 2 will be displayed here and the remaining text should be displayed when the accordion is expanded</a></h3>
    <div>
        Content 2
    </div>
    <h3><a href="#">Title 3</a></h3>
    <div>
        Content 3
    </div>
    <h3><a href="#">Title 4</a></h3>
    <div>
        Content 4
    </div>
</div>​

example fiddle:

http://jsfiddle.net/865M9/

Is there a way by which I can display only the first 20 characters of the title when the accordion is closed and then expand the text to display the complete string when the accordion element is active (expanded)?

  • 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-13T22:38:05+00:00Added an answer on June 13, 2026 at 10:38 pm

    You can restrict headlines to one line with CSS.

    For example:

    .ui-accordion-header.ui-state-default a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    

    http://jsfiddle.net/jmKu4/

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

Sidebar

Related Questions

So basically, I have a jQuery accordion. I arranged the content so that it
I have next problem: There is jquery accordion control. One of tab have div
I have a Jquery Accordion and I have a asp.net GridView below that. When
I have a jquery accordion style menu that I'd like to add some shortcut
I have a jquery accordion that I want to use nth-child to assign odd
I have a jQuery based accordion style navigation that I am trying to modify.
I have a jQuery accordion (jQuery 1.3.2, jQuery UI 1.7.2), with between 3-12 content
I have a jQuery accordion with the following markup <div id=accordion> <div class=group id=1>
I have collapsible sections created using jQuery UI Accordion. When each section is expanded
I am using jquery ui with the accordion feature running. I have a <h3></h3><div></div>

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.