简体   繁体   English

Chrome上ScrollMagic和GreenSock的问题

[英]Issues with ScrollMagic and GreenSock on Chrome

I am doing an animation with ScrollMagic and GreenSock 's TimelineMax . 我正在使用ScrollMagicGreenSockTimelineMax制作动画。 The animation is suppose to go in a WordPress page. 该动画应该放在WordPress页面中。 However the animation has some glitches when the page is open in Chrome. 但是,在Chrome中打开页面时,动画会有一些故障。 This problem does not occur in Safari and Firefox. 在Safari和Firefox中不会发生此问题。 I can't test for IE. 我无法测试IE。

This is how the problem looks like: 这是问题的样子: 滚动魔术动画

And this is how it is suppose to look like: 这是这样的样子: 在此处输入图片说明

The most bottom part with title Your web site goes up, and the two top parts move down. 标题最底端的部分您的网站上升,顶部二个部分下降。 As I said, it works perfect on Safari and Firefox, but on Chrome you have to scroll up and down to fix the issue. 就像我说的那样,它在Safari和Firefox上完美运行,但是在Chrome上,您必须上下滚动才能解决此问题。 However this is not acceptable for us, since the users of our page wont see the animation properly when they first scroll down. 但是,这对于我们来说是不可接受的,因为页面的用户在首次向下滚动时将无法正确看到动画。

Here is JSFiddle of the animation. 是动画的JSFiddle。 Now, this will most probably work without problems in JSFiddle, but when I put this in WordPress page it looks like on the first image. 现在,这很可能在JSFiddle中没有问题,但是当我将其放在WordPress页面中时,它看起来像第一个图像。 Does anybody have a clue why this happens? 有人知道为什么会发生这种情况吗?

I found the solution :) I don't want to delete the question, because I hope somebody will find it useful. 我找到了解决方案:)我不想删除问题,因为我希望有人会觉得有用。

The solution is to increase the z-index of all the elements (images, divs, everywhere where I have z-index in the css.). 解决方案是增加所有元素的z-index (图像,div,在css中我拥有z索引的任何地方)。 I increased it for 1000 on every element and it worked. 我在每个元素上都增加了1000,并且它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM