我正在使用Stellar.js v0.6.2 jQuery插件来显示具有视差效果的6个背景图像。Stellar.js页面重新加载后台位置出错
一切工作正常页面的第一次加载,但如果我重新加载/刷新它,我看到背景位置设置是错误的,并且视差效果被破坏。
这是我用Stellar.js设置:
scrollProperty: 'scroll',
positionProperty: 'position',
horizontalScrolling: false,
verticalScrolling: true,
horizontalOffset: 0,
verticalOffset: 0,
responsive: false,
parallaxBackgrounds: true,
parallaxElements: true,
hideDistantElements: true,
这是我在HTML源代码,作为一个例子:
<section class="visible" id="contact" data-stellar-background-ratio="0.6" data-stellar-vertical-offset="200"></section>
这是多么正确的后台位置看起来页面时打开第一时间:
<section class="visible" id="contact" data-stellar-vertical-offset="200" data-stellar-background-ratio="0.6" style="background-position: 30px 82.4701px;"></section>
这是它的外观,当我刷新页面:
<section class="visible" id="contact" data-stellar-vertical-offset="200" data-stellar-background-ratio="0.6" style="background-position: 30px -305.2px;"></section>
正如你所看到的,负值-305.2px是页面遗失的原因。
任何想法为什么发生这种情况,我能做些什么来防止这种情况?
THOUGHTS:是否与偏移有关?找不到答案,需要帮助。
看起来这是记录并没有处理。问题#60 https://github.com/markdalgleish/stellar.js/issues/60 – ProVega