Attendance/static/nav.js
2021-12-12 18:38:10 +08:00

10 lines
No EOL
509 B
JavaScript

$(window).resize(function() {
var sidebar = document.getElementById('sidebar');
var container = document.getElementsByClassName('container')[0];
container.style.paddingLeft = 'calc(.75rem + ' + sidebar.offsetWidth + 'px)';
});
document.addEventListener("DOMContentLoaded", function(event){
var sidebar = document.getElementById('sidebar');
var container = document.getElementsByClassName('container')[0];
container.style.paddingLeft = 'calc(.75rem + ' + sidebar.offsetWidth + 'px)';
})