Particleground.js:如何使网站可滚动

问题描述 投票:0回答:1

我正在建立一个网站并计划使用

Particleground.js

插件在我的网站的入口处。我已经下载了它here并根据演示文件使用。但是在演示中只有一个<div>,因此它们有一个全屏粒子+文本。虽然我需要像that这样的东西,即顶部带有粒子的可滚动着陆页。在此先感谢您的帮助!

这就是我的容器当前的样子:

<div id="particles">
  <div class="uk-section uk-uk-padding-medium" id="intro">
    <div class="uk-container uk-padding-large">
      <!-- content here -->
    </div>
  </div>
</div>

然后是下一个容器,我不能在那里滚动!

这是CSS设置:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1;
}

#particles {
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

#intro {
  position: absolute;
  left: 0;
  top: 50%;
  padding: 0 20px;
  width: 100%;
  text-align: center;
}
javascript jquery html css particles
1个回答
0
投票

所以,我们发现了什么问题(简单)。在CSS中它应该是这样的:

html, body {
  width: 100%;
  height: 100%;
/*   overflow: hidden; */
}

这个overflow:hidden;使事情变得如此复杂,所以只需删除它。

© www.soinside.com 2019 - 2024. All rights reserved.