[英]How to parallax headlines with Stellar.js?
I have a few elements and I am using Stellar.JS
to make elements slide while scrolling - Parallax. 我有一些元素,我正在使用
Stellar.JS
使元素在滚动时滑动-视差。
Here is the example: FIDDLE 这是示例: FIDDLE
I would like headline Trainers
to go UP while scrolling. 我希望标题
Trainers
在滚动的同时向上滚动。 I've used data-stellar-ratio="2"
on it, but it's not working. 我在上面使用了
data-stellar-ratio="2"
,但是它不起作用。
Your fiddle is not correctly set up. 您的小提琴未正确设置。 You can't link a github ressource (go to http://cdnjs.com/ to find linkable ressources), and you didn't select jquery framework.
您不能链接github资源(转到http://cdnjs.com/来查找可链接的资源),也没有选择jquery框架。 Here's a corrected one : http://jsfiddle.net/hCKG9/1/
这是更正的一个: http : //jsfiddle.net/hCKG9/1/
Moreover, to make elements "parallaxed" with Stellar.js, you must give them a position, like position:absolute
(or relative, or fixed) 此外,要使Stellar.js使元素“视差”,您必须给它们指定一个位置,例如
position:absolute
(相对或固定)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.