Animated svg script : element inner html or html widget?


(Lachnowicz) #1

Hi there,

I wonder why my svg isn’t animated within a rectangle inner html versus an html widget ?
Is it possible to make the svg script work in the simple rect ?
svg-scripted-test.hype.zip (19.3 KB)

Also, i believe that i cant keyframe /animate inner html of the widget ?

I want to control the start of the animation, so i though that i could just add and remove the < script> code on a keyframe element. ?


Animated svg not working anymore?
(Jonathan Deutsch) #2

This is a bug, sorry! Hype has to do some special work to run <script> tags in a div’s inner html with how we add content to the DOM, and it looks like we were using an older syntax to try to run the scripts that doesn’t work with modern browsers. I’ve fixed this for the next update.

Correct, the Inner HTML of an HTML Widget is not animatable. This element is really an iframe, so the amount of page loading generally isn’t appropriate in the context of animation.

Probably your best bet for now is to run the code from a Timeline Action. Here’s an example of it running 1s after the page loads:

svg-scripted-test-fixed.hype.zip (15.5 KB)


(Lachnowicz) #3

Thanks a lot Jonathan :slight_smile: