0

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

2 回答 2

0

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

于 2018-10-11T08:27:10.680 回答
0

使用 Jquery,您可以按类或特定 id 删除或隐藏任何东西

<script>
 $(document).ready(function () {
      $( ".className" ).remove();
 });
</script>

不要忘记添加 jquery 文件,如果尚未添加。

使用 CSS,您可以按类名或 id 隐藏元素/控件

.className{ display:none;}
    //if have id
    #idName{ display:none;}
于 2018-10-11T08:37:56.290 回答