I would like my list item to trigger a css3 transition to a child .pusherwhen it hangs. I'm used to doing this in JS, not css3 transitions, after reading some other SO questions, which I thought I figured out how to do, but it doesn't work correctly:
#sidebar ul {
float: left;
list-style: none;
padding: 0;
margin: 0;
width: 100%;
}
#sidebar ul li {
padding: 20px;
position: relative;
list-style: none;
border-bottom: 1px solid #4a4a4a;
cursor: pointer;
-webkit-transition: max-width 0.5s ease;
transition: max-width 0.5s ease;
}
#sidebar ul li a {
color: #fff;
z-index: 5;
position: relative;
}
#sidebar ul li a:hover {
text-decoration: none;
}
#sidebar ul li:hover > .pusher {
max-width: 100px;
height: 100%;
background: #383838;
position: absolute;
left: 0;
top: 0;
z-index: 1;
}
#sidebar ul li:first-child {
border-top: 1px solid #4a4a4a;
}
Pusher is actually added to li, with JS, but I don't think this should cause a problem? (editing: this does not seem to be a problem)
script: http://jsfiddle.net/8KpQW/
source
share