Use css for scroll positionning

- Better rendering on scroll on pages with a left block
(- It removes the warning on Firefox about scroll positionning)
This commit is contained in:
Aurélien Delobelle 2017-04-14 13:08:03 +02:00
parent 55b509b3dd
commit 0a21858b33
2 changed files with 7 additions and 10 deletions

View file

@ -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;

View file

@ -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');