简体   繁体   English

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

[英]Particleground.js: how to make website scrollable

I'm making a website and planning to use 我正在建立一个网站并打算使用

Particleground.js Particleground.js

plugin at the entrance for my site. 我网站入口处的插件。 I've downloaded it here and used according to demo file. 我已经在这里下载了它并根据演示文件使用了它。 But in demo there is only one <div> , so they have a fulscreen particles + text. 但是在演示中,只有一个<div> ,因此它们具有全屏粒子+文本。 While I need something like that , ie scrollable landing page with particles at the top. 虽然我需要这样的东西 ,即滚动登陆页面,顶部颗粒。 Thanks in advance for your help! 在此先感谢您的帮助!

That's how my container looks at the moment: 这就是我的容器目前的样子:

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

Then follows next container, and I cannot scroll there! 然后跟随下一个容器,我将无法滚动到那里!

Here are CSS settings: 以下是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;
}

So, we found what was the problem (easy). 因此,我们发现了问题所在(容易)。 In CSS it should be like this: 在CSS中应该是这样的:

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

This overflow:hidden; overflow:hidden; was making things so complicated, so just remove it. 使事情变得如此复杂,因此只需将其删除即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM