0

我希望有人帮我在 [border-bottom: 3px solid #a3c846;] 下方放置一个彩色动画进度条,例如随着变量 [timer] 的时间变慢,有人能帮我吗?谢谢!

https://forum.cfx.re/uploads/default/original/4X/2/6/d/26d360320bb48dca214037102e2188ddeb7a129d.png

$(document).ready(function(){
    window.addEventListener("message",function(event){
        var html = "<div id='"+event.data.css+"'>"+event["data"]["mensagem"]+"</div>"
        $(html).fadeIn(500).appendTo("#notifications").delay(event["data"]["timer"]).fadeOut(500);
    })
});
#sucesso {
    background: rgba(34,34,34,0.75) url("images/check.png") no-repeat center left 11px;
    border-bottom: 3px solid #a3c846;
}
<html>
    <head>
        <meta charset="UTF-8">
        <title>#creative</title>
        <script src="nui://game/ui/jquery.js"></script>
        <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
        <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <div id="notifications">
        </div>
        <script src="app.js"></script>
    </body>
</html>

4

1 回答 1

0

尝试类似的东西

$(html).fadeIn(500).appendTo("#notifications")   .animate({ width: '0%' }, event["data"]["timer"]);
于 2021-11-16T18:30:57.590 回答