如何使css通知没有jQuery? [英] How to make css notifications without jQuery?

查看:145
本文介绍了如何使css通知没有jQuery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是我想要一个通知窗口,自动隐藏一段时间后。但我不想在这里使用任何jQuery。

Simply I just want to make a notification window that automatically hide after some time. but I don't want to use any jQuery in this.

任何一个有代码?

推荐答案

您可以直接使用我的代码显示通知。

you can simply use my code to show notification.

    tn-box {
    width: 360px;
    padding: 25px 15px;
    text-align: left;
    border-radius: 5px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
    opacity: 0.9;
    position: fixed;
    top: 50px;
    color: #fff;
    background: #000;
    right: 15px;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0.9)";
    filter: alpha(opacity=0.9);
    cursor: default;
}

,然后隐藏窗口

.tn-box {
    -webkit-animation: fadeOut 5s linear forwards;
    -moz-animation: fadeOut 5s linear forwards;
    -o-animation: fadeOut 5s linear forwards;
    -ms-animation: fadeOut 5s linear forwards;
    animation: fadeOut 5s linear forwards;
}

这篇关于如何使css通知没有jQuery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆