Permalink
Browse files

when mobile, hide chapter nav at first.

  • Loading branch information...
1 parent f5e8cb7 commit ef897d4dee367fbc33c4e9c727dfaad47239ef31 @clayallsopp committed Jul 20, 2012
Showing with 12 additions and 2 deletions.
  1. +6 −0 css/chapter.css
  2. +6 −2 js/chapters.js
View
@@ -23,6 +23,12 @@ table.contents {
background-color: #ddd;
}
+@media (max-width: 786px) {
+ #chapter-nav {
+ display: none;
+ }
+}
+
nav {
height: 100%;
overflow-y: scroll;
View
@@ -1,11 +1,15 @@
$(function () {
- $("#chapter-nav-btn").click(function() {
- $("#chapter-nav").toggle();
+ var fixChevrons = function() {
if ($("#chapter-nav").is(":visible")) {
$("#chapter-nav-chevron").removeClass("icon-chevron-down").addClass("icon-chevron-up");
}
else {
$("#chapter-nav-chevron").removeClass("icon-chevron-up").addClass("icon-chevron-down");
}
+ }
+ fixChevrons();
+ $("#chapter-nav-btn").click(function() {
+ $("#chapter-nav").toggle();
+ fixChevrons();
})
});

0 comments on commit ef897d4

Please sign in to comment.