jquery - 如何删除注销按钮或链接上的启动画面?
问题描述
我在jquery上创建了启动画面它在加载页面上工作正常。当我注销页面时。再次重复同样的事情。我想在注销时删除启动动画我该怎么做?
document.addEventListener('DOMContentLoaded', () => {
document.querySelector('#splash').addEventListener('transitionend', (event) => {
event.target.remove();
});
document.querySelector('.content').addEventListener('transitionend', (event) => {
event.target.remove();
});
requestAnimationFrame(() => {
document.querySelector('#splash').classList.add('slide-out-fwd-center');
$('#splash').delay(3000).fadeOut(500, function() {
$('#splash').hide();
$('.content').css({
'display': 'block',
'animation': 'popup 0.5s ease-in-out 1'
});
});
});
});
Here is logout button which i am using .content is linking to login page
<a href="login.php" class="innerrestart" id="stop">Logout</a>
解决方案
尝试在 class="content" 上添加另一个类,该类将指定用户是否登录。然后用 $('.content.loggedin') 或 $('.content.loggedout') 选择它
推荐阅读
- python - 我如何同时运行这些?
- android - 更改 compileskdversion 时出错 (System.IO.DirectoryNotFoundException)
- reactjs - 如何在 React 中编写缺少的开发脚本?
- swift - 如何编写一个关闭视图并返回视图的函数?
- python - 数字作为python中cnf变换的符号
- blockchain - 当合约调用者已知时使用 keccak256 的 Solidity 随机数安全性
- javascript - 如何有条件地更改背景颜色?
- javascript - MongoDB 和 Heroku 部署
- c++ - 访问 DLL 中的函数时出现调试断言失败错误
- youtube-dl - youtube-dl 在文件夹加载时冻结(?)