淡出后重新出现Toast消息

时间:2017-06-11 11:28:27

标签: css

我在w3schools.com上找到了这个吐司/小吃吧的例子,我试图根据我的需要改变它,但在淡出后,它再次出现。任何人都可以帮我弄明白为什么?

https://jsfiddle.net/8qdx4j9g/

    .toast {
    visibility: visible;
    min-width: 250px !important;
    text-align: center;
    padding: 16px;
    z-index: 1;
    font-size: 17px;
    position: absolute;
    left: 30px;
    bottom: 30px;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
    from {bottom: 0; opacity: 0;} 
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@-webkit-keyframes fadeout {
    from {bottom: 30px; opacity: 1;} 
    to {bottom: 0; opacity: 0;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

0 个答案:

没有答案