首页 > 解决方案 > 如何删除注销按钮或链接上的启动画面?

问题描述

我在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>

标签: jqueryhtmlcss

解决方案


尝试在 class="content" 上添加另一个类,该类将指定用户是否登录。然后用 $('.content.loggedin') 或 $('.content.loggedout') 选择它


推荐阅读