在Stellar.js上的背景图像位置的问题 [英] Problems with background image position on Stellar.js

查看:325
本文介绍了在Stellar.js上的背景图像位置的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 stellar.js 在垂直滚动网站中添加视差效果,但我有背景位置的问题。当我使用类data-stellar-background-ratio在div上添加视差效果时,无法通过CSS将背景位置设置为向右。所有的背景图片只是去到左边,无论什么。我试图使用位置属性插件语法可​​用的网站,但它似乎打破视差效果不知何故。
任何人都可以帮助我吗?
谢谢!

解决方案

我有同样的问题。



stellar.js文件更改stellar函数,以便水平滚动设置为false(默认设置为true)。



<$ c $ p> $ .stellar({
horizo​​ntalScrolling:false
//函数的其余部分
});


I'm using stellar.js to add a parallax effect to a vertical scrolling website, but I'm having problems with the background positions. When I use the class "data-stellar-background-ratio" to add the parallax effect on a div I can't set the background position to right via CSS. All the background images just go to the left no matter what. I tried to use the position property plugin syntax available on the website, but it seems to break the parallax effect somehow. Can anybody help me? Thank you!

解决方案

I had the same issue.

In your jquery.stellar.js file change the stellar function so that horizontal scrolling is set to false (its set to true as default).

$.stellar({
horizontalScrolling:false
// rest of function
});

这篇关于在Stellar.js上的背景图像位置的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆