In the following link: http://jsfiddle.net/gCvbT/, if you click on General and then click on Question 1 for example, the answer overlaps FAQ 2. How can I prevent this?
views:
24answers:
1
+1
A:
Set the id of the h3 tag for the FAQ to "h3-faq" in order for the following code in the ready function to do the trick:
$(document).ready(function () {
$("#general-questions")
.accordion({ collapsible: true, active: false, autoHeight: false })
.bind('accordionchangestart',function(event,ui){
$('#h3-faq').animate({paddingTop: ui.newContent.height()}, 300);
});
$("#accordion")
.accordion({ collapsible: true, active: false });
});
This will add appropriate padding to the top of the FAQ h3 on click. Notice I've also set autoHeight: false
otherwise the height each content section will be set to the height of the largest content section and move the FAQ header down too much.
mVChr
2010-05-14 23:59:23
But I have more than 1 h3 tag. Can't you only id per page?
Xaisoft
2010-05-17 14:03:17
You can label and call the tags however you like, I was just giving an example. Probably better to name them iteratively somehow.
mVChr
2010-05-18 04:14:21