我正在尝试创建一个在单击按钮时淡入/淡出的菜单,并且我正在尝试使用 CSS 过渡来制作动画。
这是我想要实现的示例
#menu{
    background: red;
    display: block;    
    overflow: hidden;   
    position: absolute;
    width: 182px;
    top: 1em;
    padding: 0;
    height: auto;
    opacity: 0;
    /* The menu must not be clickable/cover the UI once hidden */
    left: -100000px;
    /*
    The left property must change after the 
    opacity is zero and before it starts to
    increase
    */
    transition: opacity 0.25s 0.1s, left 0s; /* ??? */
    -webkit-transition: opacity 0.25s 0.1, left 0s; /* Safari */
}
#menu.open{
    opacity: 1;
    left: auto;
}
当然,这只适用于一半,当菜单出现时它确实淡入,但是当它必须淡出时,这必须在元素具有正确位置之后发生。
是否可以只使用 CSS3 来做这样的事情?