How to bind the first <h3> element to jQuery Accordion?

I am using jQuery Accordion with 6 headers <h3>and several subitems <div>. When I open all the sections and close them again. The accordion ends about 100 pixels below the page.

Is there a way to snap the first one <h3>so that Accordion always closes in one place?

+5
source share
2 answers

Here is how I fixed it. The "top" and "left" parameters give the position of the accordion specific to my page.

#accordion:first-child
{
position: absolute;
top:51px;
left:8px;

}
+1
source

In your CSS, specify an absolute or fixed position

h3{
 position: absolute;
 }

or

h3{
 position: fixed;
 }
0
source

All Articles