Commit 6550b051 authored by Leo Iannacone's avatar Leo Iannacone

fix sidebar on scoll down when page is really long

parent 73b7eea5
...@@ -62,4 +62,14 @@ $(window).on('hashchange', function() { ...@@ -62,4 +62,14 @@ $(window).on('hashchange', function() {
$(window).on('load', function (){ $(window).on('load', function (){
Page.update(old_data) Page.update(old_data)
$(window).scroll(function() {
var offset = $("#file").offset();
if ($(window).scrollTop() > offset.top + 220) {
$("#sticky").stop().addClass('fixed');
}
else {
$("#sticky").stop().removeClass('fixed');
}
});
}); });
body { .fixed {
padding: 50px; position: fixed;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; width: 220px !important;
} top: 10px;
a {
color: #00b7ff;
} }
body .fixed
padding: 50px position fixed
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif width 220px !important;
a top 10px;
color: #00B7FF
\ No newline at end of file
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<ul class="nav nav-pills nav-stacked"></ul> <ul class="nav nav-pills nav-stacked"></ul>
</nav> </nav>
<div id="sticky" >
<section id="files"> <section id="files">
<h3 class="title">Files</h3> <h3 class="title">Files</h3>
<nav id="logs"> <nav id="logs">
...@@ -37,6 +38,7 @@ ...@@ -37,6 +38,7 @@
<ul></ul> <ul></ul>
</nav> </nav>
</section> </section>
</div>
</aside> </aside>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap.min.css"> <link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap-theme.min.css"> <link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="/stylesheets/style.css">
<script src='//code.jquery.com/jquery-1.7.2.min.js'></script> <script src='//code.jquery.com/jquery-1.7.2.min.js'></script>
<script src='//localhost:3000/socket.io/socket.io.js'></script> <script src='//localhost:3000/socket.io/socket.io.js'></script>
......
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