javascript - Double click to reduce size of div? -


hi wondering if there way of double clicking on div , making height reduce using css.

<div class="container"></div>     <ul class="accordion">     <li>         <a href="#first" class="accordion-header">first</a>         <div class="accordion-content" id="first">         <p>bonjour</p></div>         </li>          <li>         <a href="#second" class="accordion-header">second</a>         <div class="accordion-content" id="second">             <p>hello</p></div>         </li>           <li>         <a href="#third" class="accordion-header">third</a>         <div class="accordion-content" id="third">             <p>no</p></div>         </li> 

you can find code want adjust in fiddle.

this achievable in css only, if can add following html after each <div class="accordion-content">:

<a href="#"></a><input> 

then add these styles:

.accordion-content {   position: relative; }  .accordion-content a, .accordion-content input {   position: absolute;   height: 100%;   width: 100%;   opacity: 0; }  .accordion-content input:focus {   z-index: -1; }  .accordion-content a:focus {   z-index: 1; } 

fiddle


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Website Login Issue developed in magento -

Can the constants be defined inside a model file of a framework in PHP? -