Fix the navbar on the top for small displays
This commit is contained in:
parent
4bb0e083ae
commit
7dc976e347
2 changed files with 13 additions and 1 deletions
|
@ -25,4 +25,16 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
});
|
||||
}
|
||||
|
||||
// Fix the navbar for small displays
|
||||
if (window.screen.availWidth < 1088) {
|
||||
var nb = document.getElementById('navBar');
|
||||
if (nb !== null) {
|
||||
nb.className += " is-fixed-top";
|
||||
}
|
||||
var ms = document.getElementsByTagName('html')[0];
|
||||
if (ms !== null) {
|
||||
ms.className += " has-navbar-fixed-top";
|
||||
}
|
||||
console.log(ms);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% load static %}
|
||||
{% load i18n %}
|
||||
|
||||
<nav class="navbar is-light">
|
||||
<nav class="navbar is-light" id="navBar">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item" href="{% url 'index' %}"><img src="{% static "khaganat/images/icon_khaganat.png" %}" alt="Khaganat"></a>
|
||||
<a role="button" class="navbar-burger" data-target="navMenu" aria-label="menu" aria-expanded="false">
|
||||
|
|
Loading…
Reference in a new issue