mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
get rid of javascript (unreliable)
This commit is contained in:
parent
673b8ae99a
commit
8464d1e43e
2 changed files with 2 additions and 22 deletions
|
@ -12,8 +12,10 @@
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
|
||||||
<!-- scripting -->
|
<!-- scripting -->
|
||||||
|
<!--
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
|
||||||
<script src="/lib/app.js"></script>
|
<script src="/lib/app.js"></script>
|
||||||
|
-->
|
||||||
|
|
||||||
<!-- stylesheet -->
|
<!-- stylesheet -->
|
||||||
{% lesscss bootstrap.less %}
|
{% lesscss bootstrap.less %}
|
||||||
|
|
22
lib/app.js
22
lib/app.js
|
@ -1,22 +0,0 @@
|
||||||
$(document).ready(function(){
|
|
||||||
var docked;
|
|
||||||
var menu = document.getElementById('menu');
|
|
||||||
var init = menu.offsetTop;
|
|
||||||
|
|
||||||
window.onscroll = function () {
|
|
||||||
if (!docked && (menu.offsetTop - scrollTop() < 0)) {
|
|
||||||
menu.style.top = 0;
|
|
||||||
menu.style.position = 'fixed';
|
|
||||||
docked = true;
|
|
||||||
} else if (docked && scrollTop() <= init) {
|
|
||||||
menu.style.top = init + 'px';
|
|
||||||
menu.style.position = 'absolute';
|
|
||||||
docked = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
function scrollTop() {
|
|
||||||
return document.body.scrollTop || document.documentElement.scrollTop;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue