// Transition style
transition: 'default', // default/cube/page/concave/zoom/linear/fade/none
+ // Transition speed
+ transitionSpeed: 'default', // default/fast/slow
+
// Script dependencies to load
dependencies: []
},
dom.wrapper.classList.add( config.transition );
+ dom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed );
+
if( dom.controls ) {
dom.controls.style.display = ( config.controls && dom.controls ) ? 'block' : 'none';
}
}
- /**
- * Returns last element of an array
- */
- function lastElem(array) {
- return array.slice(-1)[0];
- }
-
/**
* Applies JavaScript-controlled layout rules to the
* presentation.
if( previousSlide ) {
indexv = ( previousSlide.querySelectorAll( 'section' ).length + 1 ) || undefined;
indexh --;
- slide();
+ slide( indexh, indexv );
}
}
}
// Returns an index (1-based) of the current fragment
getCurrentFragmentIndex : function() {
- var visibleFragments;
-
- // vertical slides:
- if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
- visibleFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment.visible' );
- }
- // Horizontal slides:
- else {
- visibleFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment.visible' );
- }
-
- if( visibleFragments.length) {
- return visibleFragments.length;
- } else {
- return undefined;
+ if( currentSlide ) {
+ var visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' );
+
+ if( visibleFragments.length ) {
+ return visibleFragments.length;
+ }
}
},