如何使SVG在Skrollr代码中滚动固定? [英] How to make the SVG fixed on scroll in Skrollr code?
本文介绍了如何使SVG在Skrollr代码中滚动固定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要SVG在滚动时保持固定(或者可以用滚动速度移动看起来固定)。 CSS没有帮助。它破坏代码。请回答。
I want the SVG to remain fixed on scroll (Or maybe move with the speed of scroll to look fixed). CSS didn't help. It ruins the code. Please answer.
如果我在CSS中使用 display:fixed;
,那么整个滚动javascript不工作
If I use display:fixed;
in CSS, then the whole scrolling javascript doesn't work.
这里是jsfiddle: http:// jsfiddle.net/tashfene/58zNp/1/
Here's the jsfiddle: http://jsfiddle.net/tashfene/58zNp/1/
请帮忙!
推荐答案
您可以尝试这样:
http://jsfiddle.net/ Sladkoff / H6vVJ /
基本上你将svg设置为 position:fixed;
围绕它,这是足够高的页面滚动。
Basically you set the svg to position: fixed;
, and put another div around it that is high enough for the page to scroll.
这篇关于如何使SVG在Skrollr代码中滚动固定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文