简体   繁体   中英

How to make the SVG fixed on scroll in Skrollr code?

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.

If I use display:fixed; in CSS, then the whole scrolling javascript doesn't work.

Here's the jsfiddle: http://jsfiddle.net/tashfene/58zNp/1/

Please help!

You could try something like this: http://jsfiddle.net/Sladkoff/H6vVJ/

Basically you set the svg to position: fixed; , and put another div around it that is high enough for the page to scroll.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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