mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-10-24 03:36:17 +02:00
suport data-id for slide links
This commit is contained in:
2
dist/reveal.esm.js
vendored
2
dist/reveal.esm.js
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.esm.js.map
vendored
2
dist/reveal.esm.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.js
vendored
2
dist/reveal.js
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.js.map
vendored
2
dist/reveal.js.map
vendored
File diff suppressed because one or more lines are too long
22
index.html
22
index.html
@@ -17,7 +17,27 @@
|
||||
<div class="reveal">
|
||||
<div class="slides">
|
||||
<section>Slide 1</section>
|
||||
<section>
|
||||
<div id="debug-text"></div>
|
||||
<div class="r-hstack">
|
||||
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
|
||||
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
|
||||
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
|
||||
</div>
|
||||
<div class="r-hstack">
|
||||
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
|
||||
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
|
||||
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
|
||||
</div>
|
||||
<div class="r-hstack">
|
||||
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
|
||||
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
|
||||
<video src="https://static.slid.es/site/homepage/v1/homepage-video-editor.mp4" width="200px" data-autoplay></video>
|
||||
</div>
|
||||
</section>
|
||||
<section>Slide 2</section>
|
||||
<section><iframe data-src="https://www.verysecureserver4u.com/en/passwords/jonas21.8"></iframe></section>
|
||||
<section><iframe data-src="https://www.verysecureserver4u.com/en"></iframe></section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -32,6 +52,8 @@
|
||||
Reveal.initialize({
|
||||
hash: true,
|
||||
|
||||
scrollActivationWidth: 0,
|
||||
|
||||
// Learn about plugins: https://revealjs.com/plugins/
|
||||
plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
|
||||
});
|
||||
|
||||
@@ -60,11 +60,13 @@ export default class Location {
|
||||
name = name.split( '/' ).shift();
|
||||
}
|
||||
|
||||
// Ensure the named link is a valid HTML ID attribute
|
||||
// Ensure the named link is a valid HTML id or data-id attribute
|
||||
try {
|
||||
slide = document
|
||||
.getElementById( decodeURIComponent( name ) )
|
||||
.closest('.slides section');
|
||||
const decodedName = decodeURIComponent( name );
|
||||
slide = (
|
||||
document.getElementById( decodedName ) ||
|
||||
document.querySelector( `[data-id="${decodedName}"]` )
|
||||
).closest('.slides section');
|
||||
}
|
||||
catch ( error ) { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user