jquery - CSS 预加载器淡出
问题描述
我怎样才能让我的预加载器顺利淡出,我下面的代码不起作用
CSS
代码.body{ width:100%; height:1000px; overflow:hidden; } #loader{ width:100px; height:100px; border:solid 5px blue; border-top:solid 5px #F69; border-bottom:solid 5px #F69; border-radius:100%; position:absolute; top:0; left:0; right:0; bottom:0; margin:auto; -webkit-animation: spin 2s linear infinite; animation: spin 2s linear infinite; } @keyframes spin{ from{ transform:rotate(0deg); width:100px; height:100px;} to{ transform:rotate(360deg); width:100px; height:100px;} }
<body onload="myFunction()" >
<div id="loader" style="z-index:999;">
</div>
</body>
脚本
功能我的功能(){ $("bloader").fadeOut(2000); myVar = setTimeout(showPage, 2000); }
解决方案
在你的脚本中
$("bloader").fadeOut(2000);
应该
$("#loader").fadeOut(2000);
推荐阅读
- python - 如何在图像中找到多个椭圆的周长?OpenCV,Python
- swift - 数据冲突 - 斯威夫特
- javascript - 我可以使用 google 日历 api 获取来自不同域的用户的信息吗?
- python - 如何使用python从文件夹中的pdf中提取文本并将它们保存在数据框中?
- mongodb - MongoDB - 查询嵌套对象
- python - Django rest 框架 websockets 自动更新
- javascript - Angular 9:错误实例不适用于自定义错误处理程序
- c++ - 我想替换 QString - QT - C++ 中的一个元素
- css - SCSS中的拉丁小写字母accent
- javascript - 当我知道对象的属性值时如何找到任何对象