fragments now work in vertical slides (fixes #4)
This commit is contained in:
parent
e6f444a307
commit
59c9b3c596
|
@ -364,7 +364,7 @@ a:not(.image) {
|
|||
border-radius: 2px;
|
||||
}
|
||||
|
||||
img {
|
||||
section img {
|
||||
margin: 30px 0 0 0;
|
||||
background: rgba(255,255,255,0.12);
|
||||
border: 4px solid #eee;
|
||||
|
|
38
js/reveal.js
38
js/reveal.js
|
@ -359,12 +359,19 @@ var Reveal = (function(){
|
|||
* false otherwise
|
||||
*/
|
||||
function nextFragment() {
|
||||
var fragments = document.querySelectorAll( '.present .fragment:not(.visible)' );
|
||||
|
||||
if( fragments.length ) {
|
||||
fragments[0].classList.add( 'visible' );
|
||||
|
||||
return true;
|
||||
if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
|
||||
var verticalFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment:not(.visible)' );
|
||||
if( verticalFragments.length ) {
|
||||
verticalFragments[0].classList.add( 'visible' );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var horizontalFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment:not(.visible)' );
|
||||
if( horizontalFragments.length ) {
|
||||
horizontalFragments[0].classList.add( 'visible' );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -377,12 +384,19 @@ var Reveal = (function(){
|
|||
* false otherwise
|
||||
*/
|
||||
function previousFragment() {
|
||||
var fragments = document.querySelectorAll( '.present .fragment.visible' );
|
||||
|
||||
if( fragments.length ) {
|
||||
fragments[ fragments.length - 1 ].classList.remove( 'visible' );
|
||||
|
||||
return true;
|
||||
if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
|
||||
var verticalFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment.visible' );
|
||||
if( verticalFragments.length ) {
|
||||
verticalFragments[ verticalFragments.length - 1 ].classList.remove( 'visible' );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var horizontalFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment.visible' );
|
||||
if( horizontalFragments.length ) {
|
||||
horizontalFragments[ horizontalFragments.length - 1 ].classList.remove( 'visible' );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user