html - Using transition to open a simple drop down I have basics but can't fit it with my design -


i need save real estate on page i'm working on wanted able hover on topics , have sub-topics accessible "drop-down" (actually div eases out) div.

here fiddle effect want:

https://jsfiddle.net/170z6pj1/

however can't seem brain around how make work this, whereby want text "how to..." trigger cause ease-out:

https://jsfiddle.net/170z6pj1/3/

i've tried various ways try , id="menu" onto "how to..." or "titleb" divs never work if way. realise base css isn't correct work, can't wrap head around need change - first time trying transitions.

thanks , responses.

p.s. far know have use "max-height workaround" dynamically adjust correct length of list items.

html:   <div id="titlea">   <div id="titleb"></div>how to...</div> <div id="menu">   <a>hover expand</a>   <ul id="list">     <li>how book meeting room</li>     <li>how book catering</li>     <li>how report cleaning requirement</li>     <li>how report fault</li>     <li>how report h&amp;s issue</li>     <li>how book hot desk</li>     <li>what happens if locked in</li>     <li>how request consumables - kitchens, photocopiers, etc.</li>     <li>out of hours issues affecting buildings / how make contact in emergency</li>     <li>recycling guide</li>     <li>complaints , feedback</li>   </ul> </div>  css:   #menu #list {   max-height: 0;   transition: max-height 1.5s ease-out;   overflow: hidden;   background-color: rgba(255, 255, 255, 0.9);   border-radius: 15px;   width: 99%;   border: 1px solid #c8ced0;   padding: 5px;   font-size: 14px;   display: inline-block; }  #menu:hover #list {   max-height: 500px;   transition: max-height 1.5s ease-in; }  #titlea {   position: relative;   -moz-box-sizing: border-box;   -webkit-box-sizing: border-box;   box-sizing: border-box;   background: #5bc0de;   padding-top: 14px;   padding-left: 22px;   height: 54px;   width: calc(100% - 35px);   margin-bottom: 5px;   margin-top: 19px;   font-size: 25px;   color: white;   font-family: 'open sans';   font-weight: bold;   }  #titleb {   position: absolute;   top: 0px;   right: -20px;   height: 100%;   width: 50px;   background: #5bc0de;   transform: skew(30deg); } 

after playing around, i've got step closer design want cutting out "non-essentials". still looking solution keep original design (second fiddle) though!

https://jsfiddle.net/170z6pj1/4/

yes, it's because apply padding , border : ul id="list"


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -