Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

when mobile, hide chapter nav at first.

  • Loading branch information...
commit ef897d4dee367fbc33c4e9c727dfaad47239ef31 1 parent f5e8cb7
@clayallsopp authored
Showing with 12 additions and 2 deletions.
  1. +6 −0 css/chapter.css
  2. +6 −2 js/chapters.js
View
6 css/chapter.css
@@ -23,6 +23,12 @@ table.contents {
background-color: #ddd;
}
+@media (max-width: 786px) {
+ #chapter-nav {
+ display: none;
+ }
+}
+
nav {
height: 100%;
overflow-y: scroll;
View
8 js/chapters.js
@@ -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();
})
});
Please sign in to comment.
Something went wrong with that request. Please try again.