Toggle On Click

In this example below you will see how to do a Toggle On Click with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by togrul, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright togrul ©
  • HTML
  • CSS
  • JavaScript
    
<div class="panel">
    <p>This is hidden content</p>
</div>

<p class="flip">sign up!</p>


/*Downloaded from https://www.codeseek.co/togrul/toggle-on-click-bdaOBj */
    div.panel,p.flip
{
    margin:0px;
    padding:5px;
    text-align:center;
    background:#e5eecc;
    border:solid 1px #c3c3c3;
}
div.panel
{
    height:120px;
    display:none;
    position:relative;
}




/*Downloaded from https://www.codeseek.co/togrul/toggle-on-click-bdaOBj */
    $(document).ready(function() {
    $(".flip").click(function() {
        $(".panel").slideToggle("slow");
    });
});

Comments