You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+32-15
Original file line number
Diff line number
Diff line change
@@ -230,6 +230,17 @@ You can add your own extensions using the same syntax. The following properties
230
230
-**condition**: [optional] Function which must return true for the script to be loaded
231
231
232
232
233
+
### Ready Event
234
+
235
+
A 'ready' event is fired when reveal.js has loaded all non-async dependencies and is ready to start navigating. To check if reveal.js is already 'ready' you can call `Reveal.isReady()`.
All presentations have a normal size, that is the resolution at which they are authored. The framework will automatically scale presentations uniformly based on this size to ensure that everything fits on any given display or viewport.
@@ -252,7 +263,7 @@ Reveal.initialize({
252
263
253
264
// Bounds for smallest/largest possible scale to apply to content
254
265
minScale:0.2,
255
-
maxScale:1.0
266
+
maxScale:1.5
256
267
257
268
});
258
269
```
@@ -339,7 +350,7 @@ Reveal.toggleAutoSlide();
339
350
// Change a config value at runtime
340
351
Reveal.configure({ controls:true });
341
352
342
-
// Returns the currently active configuration options
353
+
// Returns the present configuration options
343
354
Reveal.getConfig();
344
355
345
356
// Fetch the current scale of the presentation
@@ -350,6 +361,7 @@ Reveal.getPreviousSlide();
350
361
Reveal.getCurrentSlide();
351
362
352
363
Reveal.getIndices(); // { h: 0, v: 0 } }
364
+
Reveal.getProgress(); // 0-1
353
365
Reveal.getTotalSlides();
354
366
355
367
// State checks
@@ -360,18 +372,6 @@ Reveal.isPaused();
360
372
Reveal.isAutoSliding();
361
373
```
362
374
363
-
### Ready Event
364
-
365
-
The 'ready' event is fired when reveal.js has loaded all (synchronous) dependencies and is ready to start navigating.
To check if reveal.js is already 'ready' you can use call `Reveal.isReady()`.
374
-
375
375
### Slide Changed Event
376
376
377
377
An 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes.
The presentation's current state can be fetched by using the `getState` method. A state object contains all of the information required to put the presentation back as it was when `getState` was first called. Sort of like a snapshot. It's a simple object that can easily be stringified and persisted or sent over the wire.
390
+
391
+
```javascript
392
+
Reveal.slide( 1 );
393
+
// we're on slide 1
394
+
395
+
var state =Reveal.getState();
396
+
397
+
Reveal.slide( 3 );
398
+
// we're on slide 3
399
+
400
+
Reveal.setState( state );
401
+
// we're back on slide 1
402
+
```
403
+
404
+
### Slide States
388
405
389
406
If you set ``data-state="somestate"`` on a slide ``<section>``, "somestate" will be applied as a class on the document element when that slide is opened. This allows you to apply broad style changes to the page based on the active slide.
0 commit comments