2013-03-06 51 views
0

这是我的视差滚动代码。 见http://violetoeuvre.com/Exp_4.html视差 - 我可以添加4个以上的图层吗?

每当我添加超过4层,页面将不会加载。这仅仅是一个带宽问题?我知道我见过超过四层的网站...

我应该使用不同的代码吗?

<script type="text/javascript"> 
var wf_pbb_object = [ 
{bc:"rgba(0, 0, 0, 0)"}, 
{img:"images/Exp_4/bluediamond.png", mm:false, ms:true, mms:1, mss:30, mmd:1, mso:"v", msd:1, im:"image", pr:"both", mma:"both", ofs:{x:0, y:0}, zi:4, sr:false, sb:false, isr:false, isb:false}, 
{img:"images/Exp_4/bluestripe.png", mm:false, ms:true, mms:1, mss:40, mmd:1, mso:"v", msd:-1, im:"image", pr:"both", mma:"both", ofs:{x:0, y:0}, zi:1, sr:false, sb:false, isr:false, isb:false}, 
{img:"images/Exp_4/greenlock.png", mm:false, ms:true, mms:1, mss:50, mmd:1, mso:"v", msd:1, im:"image", pr:"both", mma:"both", ofs:{x:0, y:0}, zi:2, sr:false, sb:false, isr:false, isb:false}, 
{img:"images/Exp_4/silversq.png", mm:false, ms:true, mms:1, mss:60, mmd:1, mso:"v", msd:1, im:"image", pr:"both", mma:"both", ofs:{x:0, y:0}, zi:2, sr:false, sb:false, isr:false, isb:false} 
]; 
</script> 

提前感谢!

+0

为什么在这个例子中背部移动速度比前部快?不应该视差滚动是另一种方式? – Christoph 2013-03-06 16:15:37

+0

视差有我想要的效果,我喜欢它是颠倒的。我不认为这与添加图层有关......... – Claire 2013-03-06 16:23:25

+0

那么,没有Mozilla?有没有解决这个问题? – Claire 2013-03-06 16:34:43

回答

0

滚动重画需要0.5s +,现在要获得流畅的动画,你应该瞄准60fps!

我怀疑问题的一部分可能是图像的大小,但我没有看到更深入的那个。

如果您使用Chrome开发人员工具,请转至时间轴,开启录制,滚动页面,您将看到涂料所用的时间长度。

相关问题