Commit 6f2d2f33 authored by Oleg Roschupkin's avatar Oleg Roschupkin

Update inner navigation code.

Closes issues #4 and #58.
parent 9addbae9
......@@ -176,11 +176,11 @@
<header>
<h2>Inner Navigation</h2>
</header>
<ol class="inner">
<li class="active">This tool is provided</li>
<li>Without warranty, guarantee</li>
<li>Or much in the way of explanation
<li>Erase your hard drive.</li>
<ol>
<li>This tool is provided</li>
<li class="next">Without warranty, guarantee</li>
<li class="next">Or much in the way of explanation
<li class="next">Erase your hard drive.</li>
</ol>
</section>
</div></div>
......@@ -207,4 +207,4 @@
<!-- Copyright © 2010–2012 Vadim Makeev — pepelsbey.net -->
<!-- Photos by John Carey — fiftyfootshadows.net -->
</body>
</html>
\ No newline at end of file
</html>
......@@ -9,7 +9,7 @@
for (i = 0; i < l; i++) {
slideList.push({
id: slides[i].id,
hasInnerNavigation: null !== slides[i].querySelector('.inner')
hasInnerNavigation: null !== slides[i].querySelector('.next')
});
}
......@@ -127,13 +127,13 @@
// Shortcut for slides without inner navigation
if (true !== slideList[slideNumber].hasInnerNavigation) { return -1; }
var activeNodes = document.querySelectorAll(getSlideHash(slideNumber) + ' .active'),
// NOTE: we assume there is no other elements in inner navigation
node = activeNodes[activeNodes.length - 1].nextElementSibling;
var nextNodes = document.querySelectorAll(getSlideHash(slideNumber) + ' .next:not(.active)'),
node;
if (null !== node) {
if (0 !== nextNodes.length) {
node = nextNodes[0];
node.classList.add('active');
return activeNodes.length + 1;
return nextNodes.length - 1;
} else {
return -1;
}
......
......@@ -394,10 +394,10 @@ BODY {
}
/* Inner Navigation */
.full .inner > * {
.full .next {
opacity:0;
}
.full .inner > .active {
.full .next.active {
opacity:1;
-webkit-transition:opacity 0.5s linear;
-moz-transition:opacity 0.5s linear;
......@@ -428,4 +428,4 @@ BODY {
}
.full .progress-off {
z-index:1;
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment