Trying to work with viewbox settings
See original GitHub issueHey all,
total noob here, we have a json file we are trying to load as an SVG animation on WebFlow, I have a div element named bodymovin-1, and im loading the SVG inside that div… i wanted the animation to fill the div and also align it left… I figured out the preserve aspect ration stuff, but i can’t figure out where to add the viewbox part, or if thats even the right way to do it… any help here would be amazing
`<script> var loader = document.getElementsByClassName(“bodymovin-1”); function loadBMAnimation(loader) { var animation = bodymovin.loadAnimation({ container: loader, renderer: “svg”, loop: true, autoplay: true, viewBox: ‘700 0 2400 590’, is this the correct place to add it? rendererSettings: { progressiveLoad:false, preserveAspectRatio: ‘xMaxYMax slice’ }, path: “https://gist.githubusercontent.com/sirharjisingh/fe3b442b7eaa3cdf3065a97d10596f3a/raw/6df5406fabf2f14d3c1847ecf110735d00ee7b6c/logo.json” }); }
for (var i = 0; i < loader.length; i++) { loadBMAnimation(loader[i]); } </script>’
Issue Analytics
- State:
- Created 4 years ago
- Comments:7

Top Related StackOverflow Question
Damn, not all heros wear capes…
haha, thank you.
closing, reopen if necessary