I am working on a web page with a navigation bar along the top, consisting of an <ul>
element holding inline <li>
elements. I'd like to designate two of these list items to "slide out" when clicked, revealing additional list items.
Right now, I'm doing this by including the additional items as <li>
elements which are hidden at page load. A click event bound to the two list items toggles the visibility of those additional elements. This solution works fine, but I'd like to make things pop a little more and have these additional list items slide in and out of the list horizontally, like a drawer.
I read into the transition
CSS property, but it seems like they're tied to specific CSS properties - which would mean that a sliding animation would require a change in position, which I'm technically not doing right now. Is that correct, or is there a trick I can use to get that sliding animation?
Thank you!