2015-02-08 91 views

回答

0

您可以使用動畫關鍵幀

*{box-sizing: border-box} 
 
:root{width: 100vw; height: 100vh} 
 
body{height: 100%} 
 
menu{ 
 
    position: fixed; 
 
    top: 0; 
 
    left: 0; 
 
    width: 200px; 
 
    background: #333; 
 
    height: 100%; 
 
    padding: 20px 0; 
 
    text-align: center 
 
} 
 
menu li{ 
 
    list-style: none; 
 
    color: white; 
 
    opacity: 0; 
 
    display: block; 
 
    text-align: left; 
 
    width: 100px; 
 
    margin: 10px auto; 
 
    transform: translateX(-100%) 
 
} 
 
menu li:first-child{ 
 
    -webkit-animation: translateIntro .3s .1s ease forwards 
 
} 
 
menu li:nth-child(2){ 
 
    -webkit-animation: translateIntro .3s .2s ease forwards 
 
} 
 
menu li:nth-child(3){ 
 
    -webkit-animation: translateIntro .3s .3s ease forwards 
 
} 
 
menu li:nth-child(4){ 
 
    -webkit-animation: translateIntro .3s .4s ease forwards 
 
} 
 
menu li:last-child{ 
 
    -webkit-animation: translateIntro .3s .5s ease forwards 
 
} 
 
@-webkit-keyframes translateIntro { 
 
    to{opacity: 1;transform: translateX(0%)} 
 
}
<menu> 
 
    <li>Home</li> 
 
    <li>Pricing</li> 
 
    <li>Work</li> 
 
    <li>Lab</li> 
 
    <li>Contact</li> 
 
</menu>

+0

謝謝。我我會檢查一下d tell tq :) – user3260487 2015-02-08 17:53:25