diff options
author | Yaroslsav-95 <contact@yaroslavps.com> | 2018-10-08 10:30:16 +0300 |
---|---|---|
committer | Yaroslsav-95 <contact@yaroslavps.com> | 2018-10-08 10:30:16 +0300 |
commit | 7851ef3fd924987468b377b890cb37962805e6dc (patch) | |
tree | f3cf87e62f5dc9bad6b9d392a73ab7c5eec263da /weblog/templates | |
parent | b8680d1de69535a8c10812fef44c15684501f0c5 (diff) | |
download | w3blog-7851ef3fd924987468b377b890cb37962805e6dc.tar.gz w3blog-7851ef3fd924987468b377b890cb37962805e6dc.zip |
floating sidebar
Diffstat (limited to 'weblog/templates')
-rwxr-xr-x | weblog/templates/weblog/weblog.html | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/weblog/templates/weblog/weblog.html b/weblog/templates/weblog/weblog.html index 035ca20..e1907c6 100755 --- a/weblog/templates/weblog/weblog.html +++ b/weblog/templates/weblog/weblog.html @@ -21,7 +21,10 @@ {% endblock %} </div> {% if show_sidebar %} - <div class="weblog-sidebar"> + {% if floating_sidebar %} + <div class="sidebar-filler hidden"></div> + {% endif %} + <div class="weblog-sidebar{% if floating_sidebar %} floating-sidebar{% endif %}"> {% if show_categories %} {% if category %} {% if category == 'misc' %} @@ -39,4 +42,15 @@ </div> {% endif %} </div> +{% if floating_sidebar %} + <script> + window.addEventListener("load", function(){ + var sb_width = document.querySelector(".weblog-sidebar.floating-sidebar").offsetWidth; + var sidebar_filler = document.querySelector(".sidebar-filler"); + sidebar_filler.style.width = sb_width+"px"; + sidebar_filler.style.height = "10px"; + window.addEventListener("scroll", floatSidebar); + }); + </script> +{% endif %} {% endblock %} |