喜欢这个小图书馆。但是,我似乎根本无法使数据属性正常工作。我尝试将速度设置为0静态,并尝试禁用移动设备(我认为它是默认设置),但没有成功。我不确定是什么问题。
代码如下:
HTML:
<div class="parallax-window vanity-banner-container" data-speed="0.0" data-parallax="scroll" data-image-src="https://cdn.shopify.com/s/files/1/0016/3387/8103/files/vanityGlamBG.jpg?2591707482400048148">
<div class="parallax-content-container">
<img class="van-glam" src="https://cdn.shopify.com/s/files/1/0016/3387/8103/files/VanGlam.png?16888294906577413236"><span class="tm">™</span>
<div class="van-content">Here's some stuff that I want to display as some content</div>
<div class="van-shopBtn">SHOP</div>
</div>
CSS:
.parallax-window{
height:500px;
background:transparent;
margin-top:3%;
}
.parallax-mirror{
z-index:100!important;
}
视差效果很好,并且可以在页面上滚动,但是我想将其实现到我的雇主网站中,我希望以后可以选择使用属性,以防可能发生更改。例如,现在,即使在上面的文本中,我将data-speed属性设置为“ 0.0”,滚动仍然处于活动状态:
<div class="parallax-window vanity-banner-container" data-speed="0.0" data-parallax="scroll" data-image-src="https://cdn.shopify.com/s/files/1/0016/3387/8103/files/vanityGlamBG.jpg?2591707482400048148">
有什么我想念的吗?我知道其他属性都起作用,因为在这种情况下,我的图像将不会显示并且不会随着页面滚动。任何帮助,将不胜感激。谢谢,