javascript - reveal.js - Navigate through slides like on a grid or a checkerboard -


i know if it's possible navigate between slides in reveal.js moving on grid or checkerboard (reason explained @ bottom of post). @ moment when move new stack of slides, 1 takes focus topmost of next stack. normal behavior presentation-oriented software not slideshow-oriented tool.

i'd override behavior presentations require moving , forth along rows of different columns, not confident javascript @ all. until i've found right places in source changes should occur might be:

  • in function slide (the 1 changes slide): line 1464, set vertical indices same value, instead of last slide only.

  • functions navigateleft , navigateright (lines 2537 , 2552) use horizontal index instead of 'indexh' , 'indexv'.

a possible solution not involve source code posted year ago here on stackoverflow jfriend00 (using-arrowkeys-to-navigate-through-4x4-grid) don't know how should implemented in external .js file or in main .html file.


why think important?
i'll make example not case easy enough understand.
let's assume perform clinical study of 15 analyses on 50 patients, , want @ graphs (generated python, matlab or r in raster or vector format) on photo grid, arranged patients on columns , analyses on rows. , let's want see results of 9th analysis patients. problem if click "right arrow" key, reveal.js shows 1st (or last visited) slide on next column.
intuitively, have during presentation public audience, not boss or collaborators during private office/lab meeting.

ok, found solution , hope going else same problem.

in file reveal.js, can comment lines 1550 , 1561, , replace second argument of function setpreviousverticalindex (a zero) indexv. final result looks this.

//if ( document.queryselector( home_slide_selector ).classlist.contains( 'present' ) ) { // launch async task     settimeout( function () {         var slides = toarray( document.queryselectorall( horizontal_slides_selector + '.stack') ), i;         for( in slides ) {             if( slides[i] ) {                 // reset stack                 setpreviousverticalindex( slides[i], indexv );             }         }     }, 0 ); //} 

in way, every time change slide (the function slide called) every stack's vertical index become same of slide you're moving towards.
please don't forget minify code again or switch reveal.js instead of reveal.min.js in html file.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -