I need my list item to activate a css3 transition on its child element .pusher
when it is hovered over.
I usually achieve this using JS, but I want to try implementing it with css3 transitions. After reading some other questions on SO, I attempted to do it myself, yet it's not functioning as expected:
#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;
}
The Pusher element is actually added to li dynamically using JS, but I don't believe this should be causing the problem? (edit: this doesn't seem to be the issue)
See the fiddle here: http://jsfiddle.net/8KpQW/