-
I have an SVG image that I'd like to incrementally reveal its parts (maybe at some point even animate). I tried setting Can such thing be done? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I tried a plugin a long time ago, that I wasn't able to get working, but there are others that I haven't tried. |
Beta Was this translation helpful? Give feedback.
-
Yes, this is possible, but you have to embed the SVG graphic in the presentation. Since you have the SVG images as separate files, one way of doing this which is relatively painless is to use PHP, as follows: <p>
Some text before the image.
<?php echo file_get_contents("./path/to/file.svg"); ?>
Some text after the image.
</p> Alternatively, you could do this with JavaScript, as follows: <section>
<h3>title</h3>
<div id='foo'></div>
</section>
<script>
fetch('./path/to/file.svg')
.then(response => response.text())
.then(svgContent => {
document.getElementById('foo').innerHTML = svgContent;
});
</script> |
Beta Was this translation helpful? Give feedback.
I tried a plugin a long time ago, that I wasn't able to get working, but there are others that I haven't tried.