From 0a21858b337c543b46d49a4cae9851dc17f86da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Fri, 14 Apr 2017 13:08:03 +0200 Subject: [PATCH] Use css for scroll positionning - Better rendering on scroll on pages with a left block (- It removes the warning on Firefox about scroll positionning) --- kfet/static/kfet/css/index.css | 7 +++++++ kfet/static/kfet/js/kfet.js | 10 ---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/kfet/static/kfet/css/index.css b/kfet/static/kfet/css/index.css index 0244a57b..ce7e0dff 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -134,6 +134,13 @@ textarea { padding:0; } +@media (min-width: 768px) { + .col-content-left { + position: sticky; + top:50px; + } +} + .content-left-top { background:#fff; padding:10px 30px; diff --git a/kfet/static/kfet/js/kfet.js b/kfet/static/kfet/js/kfet.js index cc369e32..72ae675a 100644 --- a/kfet/static/kfet/js/kfet.js +++ b/kfet/static/kfet/js/kfet.js @@ -1,14 +1,4 @@ $(document).ready(function() { - $(window).scroll(function() { - if ($(window).width() >= 768 && $(this).scrollTop() > 72.6) { - $('.col-content-left').css({'position':'fixed', 'top':'50px'}); - $('.col-content-right').addClass('col-sm-offset-4 col-md-offset-3'); - } else { - $('.col-content-left').css({'position':'relative', 'top':'0'}); - $('.col-content-right').removeClass('col-sm-offset-4 col-md-offset-3'); - } - }); - if (typeof Cookies !== 'undefined') { // Retrieving csrf token csrftoken = Cookies.get('csrftoken');