• 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>
     <div></div>
<!-- this fails as well-->
 <h3><href="index.html" >A html page <p>Summery text Here</p>
</a></h3>
     

Open in new window

0
trevor1940
Asked:
trevor1940
  • 2
  • 2
1 Solution
 
TvMptCommented:
Inside the event click use the .append

something like:
$('#the_a_id').append(' <p>Summary text Here this is collapsed</p>');
0
 
leakim971PluritechnicianCommented:
0
 
trevor1940Author Commented:
leakim971
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!
0
 
leakim971PluritechnicianCommented:
What about this : http://jsfiddle.net/mBdYu/7/
0
 
trevor1940Author Commented:
Sweet!

Plugged it into previous code & worked a treat!
0
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