简体   繁体   中英

Simple parallax scrolling doesn't work

I'm trying to add simple parallax scrolling to my website using stellar.js . The problem is that it just simply doesn't work; I feel like I've tried everything but it just doesn't work. I made this test jsfiddle because I thought it didn't work because it interfered with some of the other code on my website. But even on this test page on which I'm only trying to get parallax scrolling to work it won't work for some reason.

http://jsfiddle.net/5Jctk/4/

I'm calling the stellar.js library like this (as you can see in the fiddle):

$(document).ready(function () {
    $.stellar();
});

Why isn't this working on either my website and the jsfiddle?

您没有为要滚动的每个单独的元素设置data-stellar-ratio ,而且还必须指定单独滚动的每个元素的像素高度。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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