1

我正在建立一个我在这里托管的网站:

http://whendoesitair.info/

我在登录页面上遇到了两个问题。

1.)右键单击​​ div 外部时,右键单击上下文菜单是非标准的。前任:H

这是我试图在您右键单击的任何地方发生的正确行为的示例:

在此处输入图像描述

2.)另一个(次要)问题是,当您直接左键单击 div 的右侧或左侧时,粒子将不起作用。例如,在标题标签或搜索框的右侧或左侧。

这是我如何在我的:

索引.html

<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>WhenDoesItAir</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

<body style="display: block; height: 0vh; z-index: 5;">
  <app-root></app-root>
    <div id="particles-js" style="position: absolute; display: block; top: 0; left: 0; width: 100%; height: 100%; z-index: -5;">
  </div>
  <script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
</body>

</html>

这就是我在我的登陆页面中加载粒子的方式,在我的

Landingpage.component.ts

  declare var particlesJS: any;
  ngOnInit(): void {
    // particles
     particlesJS.load('particles-js', 'particles.json', null);
  }

用户右键单击时如何提供正确的上下文菜单?或者当它与 div 重叠时如何修复粒子行为?

4

0 回答 0