html - Unable to get menu to expand with expanding submenu -
i'm having difficult time getting expanding menu work. have need have menu has items has sub menu items. don't want sub menu items displayed. approach want use have , arrow (analogous + sign) left of menu items have sub menu items. want user able select arrow display sub menu items. arrow change direction (analogous - sign). issue not in getting arrow , sub menus show. issue in expanding upper level div show sub menu items. (see sample)
#navigation_slideout { position: fixed; top: 85px; left: -370px; -webkit-transition-duration: .5s; -moz-transition-duration: .5s; -o-transition-duration: .5s; transition-duration: .5s; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0 0 40px #222; -moz-box-shadow: 0 0 40px #222; box-shadow: 0 0 40px #222; } #navigation_slideout:hover { left: -39px; } #navigation_slideout ul { list-style: none; } #navigation_slideout ul li { background: #548ebe; width: 325px; height: 30px; text-align: left; padding-top: 5px; font-family: helveticaneue, helvetica neue, helvetica, arial, sans-serif; font-size: 12pt; color: white; font-weight: bold; } #navigation_slideout ul li { color: #000; text-decoration: none; font-weight: bold; display: block; background-color: #548ebe; color: white; } #navigation_slideout ul li ul { width: 285px; } #navigation_slideout ul li ul li { width: 10px; position: relative; left: -41px; } #navigation_slideout ul li ul li { background: #548ebe; width: 326px; height: 30px; text-align: left; padding-top: 5px; font-family: helvetica, arial, sans-serif; font-size: 12pt; color: white; font-weight: bold; } #menu { -ms-transform: rotate(-90deg); -webkit-transform: rotate(-90deg); transform: rotate(-90deg); font-family: helveticaneue, helvetica neue, helvetica, arial, sans-serif; font-size: 14pt; color: white; font-weight: bold; margin: 0px 0px 0px 0px; right: 0px; padding: 0px 0px 0px 0px } #menu { font-size: 14pt; color: white; font-weight: bold; text-decoration: none; } table.nospacing { border-collapse: collapse; border-spacing: 0; table-layout: fixed; } table.nospacing th, td { padding: 0; } .menu-col { max-width: 30px; } .expanding25 label { /*background-color: #aaafab; border-radius: 5px; color: white; */ padding: 3px; padding-left: 25px; } .expanding25 li { margin: 2px 2px 2px 0; padding: 5px; } .expanding25 li > ul { left: -35px; position: relative; width: 100% } .expanding25 input[type=checkbox] { display: none; } .expanding25 input[type=checkbox] ~ ul { max-height: 0; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; -webkit-transition: 1s ease; -moz-transition: 1s ease; -o-transition: 1s ease; transition: 1s ease; } .expanding25 input[type=checkbox]:checked ~ ul { max-height: 100%; max-width: 100%; opacity: 1; } .expanding25 input[type=checkbox] + label:before { transform-origin: 25% 50%; border: 8px solid transparent; border-width: 8px 12px; border-left-color: white; margin-left: -20px; width: 0; height: 0; display: inline-block; text-align: center; content: ''; color: #aaafab; -webkit-transition: .5s ease; -moz-transition: .5s ease; -o-transition: .5s ease; transition: .5s ease; position: absolute; margin-top: 1px; } .expanding25 input[type=checkbox]:checked + label:before { transform: rotate(90deg); /*margin-top: 6px; margin-left: -25px;*/ } <div id="navigation_slideout" style="background-color:#548ebe;z-index:1" onclick=""> <table class="nospacing" style="border-style:none"> <tr> <td> <ul> <li> title</li> <li><a href="#"> home</a> </li> <li><a href="#"> about</a> </li> <li><a href="#"> contacts</a> </li> <li><a href="#"> faqs</a> </li> <li class="expanding25"> <input class="expanding25" type="checkbox" id="cb28" /> <label class="expanding25" for="cb28">topic areas</label> <ul class="expanding25"> <li class="expanding25"> <label class="expanding25">topic 1</label>content</li> <li class="expanding25"> <label class="expanding25">topic 2</label>content</li> <li class="expanding25"> <label class="expanding25">topic 3</label>content</li> <li class="expanding25"> <label class="expanding25">topic 4</label>content</li> </ul> </li> </ul> </td> <td class="menu-col" style="border-left:medium;border-left-color:white;border-left-style:solid"> <p id="menu">menu</p> </td> </tr> </table> </div>
all #navigation_slideout ul li getting height: 30px, submenu inside li can’t grow tall enough show it. adding style fix it:
#navigation_slideout ul li.expanding25 { height: auto }
Comments
Post a Comment