I’m new to JQuery and I’m creating a site where one can click on one of several links, and a div will pop up with information about that link. The code currently hides all the divs at the start of the page, and uses slideToggle() to show it independently when they’re clicked. The only problem is: they’re in order in the HTML document. I want to so whichever link you click, it moves all the divs that are being shown, down to make room for the newest one.
For example:
User clicks Section1. Section1 shows up.
User clicks Section2. Section1 is moved down. Section2 shows up on top.
Any ideas on how to do this? I tried using prepend() and insert() but to no avail.
Thanks, Derek.
prependwill add your content to the beginning rather than the end.