reveal-svg-fragment.js
as a dependency<section>
of reveal.js markupdata-svg-fragment="<url of the someplace>"
to something, e.g.
a div
class="fragment"
inside that thingtitle="<a selector>"
to those things[*|label=<a label>]
is goodLet’s assume I made an SVG in Inkscape, and saved it next to my index.html
.
It has three layers: base
, fragment1
and fragment2
.
<html>
...
<section>
<div data-svg-fragment="figure.svg#[*|label=base]">
<a class="fragment" href="[*|label=fragment1]"></a>
<a class="fragment" href="[*|label=fragment2]"></a>
</div>
</section>
...
<script>
...
Reveal.initialize({
dependencies: [
...
{
// maybe you put this in `plugins`
src: 'reveal-svg-fragment.js',
condition: function(){
return !!document.querySelector( '[data-svg-fragment]' );
}
// Additional options
// defaults to using already-loaded version, or CDN
//d3: "./d3.min.js",
// use a different attribute for your fragment selector
//selector: "title",
}
...
]
...
}
...
</script>
...
</html>
file://
python -m SimpleHTTPServer