stellar.js

stellar.js 视差滚动

*爱你&永不变心* 提交于 2020-10-31 03:09:54
1.引入包 <script src="js/jquery.min.js"></script> <script src="js/jquery.stellar.js"></script> 2.设置 设置视差元素的随页面滚动的速率 data-stellar-background-ratio="0.3" //数值越大滚动越快 凡是需要做视差滚动的都需要加上样式 background-attachment: fixed; 3.初始化 $( function () { $.stellar({ horizontalScrolling: false , verticalScrolling: true , }); }); ============================================================== $.stellar({ // 设置滚动的方向是“竖直方向”还是“水平方向”,或者两个方向都有 horizontalScrolling: true , // 默认水平方向开启滚动 verticalScrolling: true , // 默认竖直方向开启滚动 // 设置全局偏移 horizontalOffset: 0, // 默认水平偏移为0 verticalOffset: 0, // 默认竖直偏移为0 // 窗口加载完毕或者改变大小时是否刷新滚动元素

Stellar Parallax to run on desktop, static image on mobile device

笑着哭i 提交于 2020-01-05 02:36:46
问题 My website is using Stellar.js to create a parallax effect on a number of images that cover the width of the users screen. Stellar scrolls across the image at half the speed the user scrolls down the page creating a nice effect. I originally used this code: MY CSS FILE /* Separator About - Parallax Section */ .sep { background-attachment: fixed!important; background-position: 50% 0!important; background-repeat: no-repeat!important; width: 100%!important; height: 180px!important; position:

Disable horizontal scroll on parallax

早过忘川 提交于 2019-12-08 03:47:40
问题 I made a site parallax scrolling, using slider and stellarjs. This works well for scrolling up and down, but it also scrolls horizontally and I do not want. So i want to disable horizontally scrolling and keep my width at 100% of user screen or at a specific width. here's the website : ecolopeintre.com/index_para.php 回答1: Stellar offers options, please review docs http://markdalgleish.com/projects/stellar.js/docs/ In order to turn off horizontal scrolling please review the code below

How to create parallax effect like this?

牧云@^-^@ 提交于 2019-11-30 14:23:35
问题 I've been trying to get build a website with a parallax effect like the one on this website: http://www.sparksandhoney.com/the-open-agency-index/ or http://www.sparksandhoney.com/press-index/ I've been trying to use stellar.js, but I can't seem to make the nav bar and web page scroll in sync over the image like this website. So far I've just been trying to make the nav bar and text layer be one div that scrolls over a fixed background but that is not working at all? By the way, I've gone

How to create parallax effect like this?

本小妞迷上赌 提交于 2019-11-30 10:51:27
I've been trying to get build a website with a parallax effect like the one on this website: http://www.sparksandhoney.com/the-open-agency-index/ or http://www.sparksandhoney.com/press-index/ I've been trying to use stellar.js, but I can't seem to make the nav bar and web page scroll in sync over the image like this website. So far I've just been trying to make the nav bar and text layer be one div that scrolls over a fixed background but that is not working at all? By the way, I've gone through this websites source code, and they use Squarespace, but I'm trying to do the effect without it.