简体   繁体   English

jQuery Parallax.js无法正常工作

[英]jQuery Parallax.js not working

im trying to work with parallax.js but its not working regularly. 我试图与parallax.js一起使用,但无法正常工作。 My parallax div is not moving when im scrolling. 我滚动时我的视差div没有移动。 I cant find the where the problem is. 我找不到问题所在。 Here's the link im trying to work with. 这是我尝试使用的链接。 parallax.html parallax.html

This is not an answer, but a lengthy comment with some suggestions to try. 这不是答案,而是冗长的评论和一些建议。

Yeah, your parallax is not parallaxing... However, here are some things to try: 是的,您的视差不是视差...但是,请尝试以下操作:

(1) Add a new DIV immediately under body: (1)在主体下面添加一个新的DIV:

<div style="height:200px;width:100%;background:white;">&nbsp;</div>

(2) Add this style to your parallax div: (2)将此样式添加到视差div中:

<div style="background:white;" class="parallax-window" data-parallax="scroll" data-image-src="http://pixelcog.github.io/parallax.js/img/helix-nebula-1400x1400.jpg"></div>

That will help with the "window" effect, but I'm not sure why the parallax effect (slower scroll speed inside window) not working. 这将有助于“窗口”效果,但是我不确定为什么视差效果(窗口内滚动速度较慢)不起作用。

Of course, you can use external styling, I only used inline styling for purpose of demonstration 当然,您可以使用外部样式,我仅使用内联样式进行演示

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

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