Created
July 27, 2014 15:09
-
-
Save io41/a6369184c8217bc26f6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
history={'data': [ | |
{ | |
'o': 0, /* offset */ | |
'h': 1, /* horizontal slide index */ | |
'v': 0, /* vertical slide index */ | |
}, | |
{ | |
'o': 120, | |
'h': 2, | |
'v': 0, | |
}, | |
{ | |
'o': 180, | |
'h': 3, | |
'v': 0, | |
}, | |
{ | |
'o': 300, | |
'h': 1, | |
'v': 0, | |
}, | |
]} | |
var currentIndex = 2; | |
function getCurrentSlide(){ | |
return history['data'][currentIndex]; | |
} | |
function getNextSlide() { | |
return history['data'][currentIndex + 1]; | |
} | |
function getStartOffSet(position) { | |
return 0 | |
} | |
function setCurrentSlide(position) { | |
var state = getCurrentState(); | |
var currentOffset = getStartOffset(position) + state['o']; | |
var nextOffset = getStartOffset(position) + getNextState()['o']; | |
if (position < currentOffset) { | |
currentIndex -= 1; | |
} else if (position > nextOffset) { | |
currentIndex += 1; | |
} | |
setSlide(); | |
} | |
function setSlide() { | |
var slide = getCurrentSlide(); | |
reveal.slide(slide['h'], slide['v']); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment