Solved

jQuery accordion with google like summery

Posted on 2013-05-31
5
304 Views
Last Modified: 2013-05-31
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
Comment
Question by:trevor1940
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:TvMpt
ID: 39210279
Inside the event click use the .append

something like:
$('#the_a_id').append(' <p>Summary text Here this is collapsed</p>');
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39210719
0
 
LVL 1

Author Comment

by:trevor1940
ID: 39211010
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
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39211143
What about this : http://jsfiddle.net/mBdYu/7/
0
 
LVL 1

Author Closing Comment

by:trevor1940
ID: 39211422
Sweet!

Plugged it into previous code & worked a treat!
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery (http://jquery.com/) 1.6 introduces .prop() (http://api.jquery.com/prop/) and .removeProp() (http://api.jquery.com/removeProp/) methods which allow modifying or removi…
What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question