css - Cross Browser Pure CSS3 Vertical Accordion - Keep window open until another window is clicked -
how edit code window stay open when mouse no longer hovering, close when window/category selected?
.verticalaccordion>ul { margin: 0; padding: 0; list-style:none; width: 500px; } .verticalaccordion>ul>li { display:block; overflow: hidden; margin: 0; padding: 0; list-style:none; height:40px; width: 500px; /* decorative css */ background-color:#f0f0f0; /* css3 transition effect */ transition: height 0.3s ease-in-out; -moz-transition: height 0.3s ease-in-out; -webkit-transition: height 0.3s ease-in-out; -o-transition: height 0.3s ease-in-out; } .verticalaccordion>ul>li>h3 { display:block; margin: 0; padding:10px; height:19px; /* decorative css */ border-top:#f0f0f0 1px solid; font-family: arial, helvetica, sans-serif; text-decoration:none; text-transform:uppercase; color: #000; background: #cccccc; /* css3 gradient effect */ background: -moz-linear-gradient( top, #999999, #cccccc); background: -webkit-gradient(linear, left top, left bottom, from(#999999), to(#cccccc)); filter: progid:dximagetransform.microsoft.gradient(startcolorstr=#ff999999, endcolorstr=#ffcccccc); /* ie 7 */ -ms-filter: "progid:dximagetransform.microsoft.gradient(startcolorstr=#ff999999, endcolorstr=#ffcccccc)"; /* ie 8 */ } .verticalaccordion>ul>li>div { margin:0; overflow: auto; padding:10px; height:220px; } .verticalaccordion>ul>li:hover { height: 280px; } .verticalaccordion:hover>ul>li:hover>h3 { /* decorative css */ color:#fff; background: #000000; /* css3 gradient effect */ background: -moz-linear-gradient( top, #454545, #000000); /* ff, flock */ background: -webkit-gradient(linear, left top, left bottom, from(#454545), to(#000000)); /* safari, chrome */ filter: progid:dximagetransform.microsoft.gradient(startcolorstr=#ff454545, endcolorstr=#ff000000); /* ie 5.5 - ie 7 */ -ms-filter: "progid:dximagetransform.microsoft.gradient(startcolorstr=#ff454545, endcolorstr=#ff000000)"; /* ie 8 */ } .verticalaccordion>ul>li>h3:hover { cursor:pointer; } <div class="verticalaccordion"> <ul> <li> <h3>heading 1</h3> <div>content panel 1.</div> </li> <li> <h3>heading 2</h3> <div>content panel 2</div> </li> <li> <h3>heading 3</h3> <div>content panel 3.</div> </li> <li> <h3>heading 4</h3> <div>content panel 4</div> </li> </ul> </div> here source above code: cross browser pure css3 vertical accordion
you can't know in pure css happens element placed after current 1 (or children). :target + li > a:hover, :focus ~ blah or whatever make up, won't know first link when happens third one.
use jquery (or js or framework) complex menus, it's more usable better compatibility not old browsers ;)
Comments
Post a Comment