• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

jQuery accordion with google like summery

This is a follow on from This question

My accordion contains links within the header, when the link is clicked the accordion expanded contents is loaded via an ajax query
each header looks like this

 <h3><a id="1" href="index.html" >A html page</a></h3>

Open in new window

How do i display a summery when the accordion is collapsed  similar to how a google search is shown.

the code bellow breaks the accordion but this is what I'm trying to achieve

 <h3><a href="index.html" >A html page</a></h3>
      <p>Summery text Here</p>
     <div>Full page loaded here</div>
 <h3><a href="page.html" >Another html page</a></h3>
      <p>Summery text Here this is collapsed   </p>
<!-- this fails as well-->
 <h3><href="index.html" >A html page <p>Summery text Here</p>

Open in new window

  • 2
  • 2
1 Solution
Inside the event click use the .append

something like:
$('#the_a_id').append(' <p>Summary text Here this is collapsed</p>');
trevor1940Author Commented:
click one
"page one" is shown
click two

"page two" is shown

but the summery for page one is now hidden &  the content remains.
shouldn't that be the other way around

eg the summaries are always visible but the content gets hidden!
What about this : http://jsfiddle.net/mBdYu/7/
trevor1940Author Commented:

Plugged it into previous code & worked a treat!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now