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,20 +23,22 @@ ...@@ -23,20 +23,22 @@
<ul class="nav nav-pills nav-stacked"></ul> <ul class="nav nav-pills nav-stacked"></ul>
</nav> </nav>
<section id="files"> <div id="sticky" >
<h3 class="title">Files</h3> <section id="files">
<nav id="logs"> <h3 class="title">Files</h3>
<ul class="nav nav-pills nav-stacked"></ul> <nav id="logs">
</nav> <ul class="nav nav-pills nav-stacked"></ul>
<nav id="archives"> </nav>
<h4>Archives</h4> <nav id="archives">
<ul></ul> <h4>Archives</h4>
</nav> <ul></ul>
<nav id="debs"> </nav>
<h4>Debs</h4> <nav id="debs">
<ul></ul> <h4>Debs</h4>
</nav> <ul></ul>
</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