Search code examples
javascriptjquerystylingjquery-effects

jQuery Sliding Form Expanding Outside of Parent Element's "Wrapper"


I'm trying to build a basic contact form using jQuery. The markup is essentially a <section> containing a second-level heading (<h2>) and a <div> containing labels for a sibling <form>. My desired effect is to have the label container and the form appear by sliding down when the second-level heading is clicked. This is currently working, but the two containers expand outside of their parent element. To see what I mean by this, you can view a page I constructed that is identical in terms of the section in question to the page I am actually building here


Solution

  • Just change the CSS to:

    #contact {
      overflow: auto;
    }