Browse Source

Fix error on ff and scrolling design

Maxime Vidori 9 years ago
parent
commit
93f9fe8c50
2 changed files with 32 additions and 11 deletions
  1. 25 5
      theme/static/css/main.css
  2. 7 6
      theme/static/scripts/mine.js

+ 25 - 5
theme/static/css/main.css

@@ -28,7 +28,13 @@ body {
 
 
 /* Headings */
 /* Headings */
 h1 {font-size: 2em }
 h1 {font-size: 2em }
-h2 {font-size: 2.5em; text-transform: uppercase;margin-top:80px;margin-bottom: .8em; padding-top: 10px;}	/* 22px */
+h2 {
+  font-size: 2.5em;
+  text-transform: uppercase;
+  padding-top:90px;
+  margin-bottom: .8em; /* 22px */
+}
+
 h2:first-child {margin-top:0;}	/* 22px */
 h2:first-child {margin-top:0;}	/* 22px */
 h3 {font-size: 2em; color: #999; margin-top: 40px}	/* 20px */
 h3 {font-size: 2em; color: #999; margin-top: 40px}	/* 20px */
 h4 {font-size: 1.7em; margin-top: 30px;font-weight: 300;}	/* 18px */
 h4 {font-size: 1.7em; margin-top: 30px;font-weight: 300;}	/* 18px */
@@ -245,12 +251,27 @@ nav#side-nav {
   padding-right: 60px;
   padding-right: 60px;
 }
 }
 
 
+
 nav#side-nav ul {
 nav#side-nav ul {
+  position: relative;
   list-style: none;
   list-style: none;
-  border-right: 1px solid #CCC;
-  padding-right: 40px
+  padding-right: 40px;
 }
 }
 
 
+
+nav#side-nav ul:before {
+  content: '';
+  margin: 25px 0;
+  position: absolute;
+  z-index: -1;
+  right: -1px;
+  bottom: -1px;
+  top: -1px;
+  border: 1px solid #ccc;
+  border-left-width: 0;
+}
+
+
 nav#side-nav ul li a {
 nav#side-nav ul li a {
   padding-right: 40px;
   padding-right: 40px;
   margin-right: -47px;
   margin-right: -47px;
@@ -277,7 +298,6 @@ nav#side-nav ul li a {
 }
 }
 
 
 
 
-
 /*
 /*
 Content
 Content
  *****************/
  *****************/
@@ -318,8 +338,8 @@ Featured
 /*
 /*
 Body
 Body
  *****************/
  *****************/
+
 .container {
 .container {
-  background: #fff;
   margin-bottom: 2em;
   margin-bottom: 2em;
   overflow: hidden;
   overflow: hidden;
   padding: 20px 20px;
   padding: 20px 20px;

+ 7 - 6
theme/static/scripts/mine.js

@@ -1,16 +1,17 @@
-var wdw = $(window);
+var $window = $(window);
 var hash = window.location.hash;
 var hash = window.location.hash;
 
 
 window.location.hash = ''; // avoid going to anchor
 window.location.hash = ''; // avoid going to anchor
 
 
-wdw.on('load', function() {
+
+$window.on('load', function() {
   var content = $('#content');
   var content = $('#content');
   var size = 24; // magic number !
   var size = 24; // magic number !
 
 
   content.find('h2:last').add('h2:last ~ *').each(function() {
   content.find('h2:last').add('h2:last ~ *').each(function() {
     size += $(this).outerHeight(true);
     size += $(this).outerHeight(true);
   });
   });
-  content.css('margin-bottom', wdw.height() - size);
+  content.css('margin-bottom', $window.height() - size);
 
 
   $('#toc').sticky({topSpacing:30});
   $('#toc').sticky({topSpacing:30});
 
 
@@ -23,16 +24,16 @@ wdw.on('load', function() {
     var navItem = {
     var navItem = {
       'nav': $(item),
       'nav': $(item),
       'anchor': {'name': anchor, 'item': anchorItem},
       'anchor': {'name': anchor, 'item': anchorItem},
-      'pos': anchorItem.offset().top - 80
+      'pos': anchorItem.offset().top
     };
     };
     navItemsMap[anchor] = navItem;
     navItemsMap[anchor] = navItem;
     return navItem;
     return navItem;
   });
   });
 
 
 
 
-  wdw.scroll(function(){
+  $window.scroll(function(){
     var nav;
     var nav;
-    var pos = wdw.scrollTop();
+    var pos = $window.scrollTop();
     $.each(navItems, function(_, item) {
     $.each(navItems, function(_, item) {
       return pos > item.pos - 1 ?  nav = item.nav : false;
       return pos > item.pos - 1 ?  nav = item.nav : false;
     });
     });