Use readystatechange for active links
This commit is contained in:
parent
c9127e3384
commit
6f945e72f3
@ -18,7 +18,7 @@
|
||||
<div class="column col-sm-2 show-sm text-right">
|
||||
<i class="icon icon-menu icon-2x"></i>
|
||||
</div>
|
||||
<div class="hide-sm column col-lg-5 col-sm-12 col-md-120 col-md-10 nav-light nav-menu" id="links">
|
||||
<div class="hide-sm column col-lg-5 col-sm-12 col-md-10 nav-menu" id="links">
|
||||
<a href="index.html" title="Torna alla home page">Home</a>
|
||||
<a href="progetto.html" title="Vai alla descrizione del progetto">Il progetto</a>
|
||||
<a href="itinerario.html" title="Vai all'itinerario">L'itinerario</a>
|
||||
|
2
js/ui.js
2
js/ui.js
@ -39,7 +39,7 @@ if (homeRE.test(window.location.href)) {
|
||||
* Apply active class to selected link...
|
||||
* @todo Inefficient!!
|
||||
*/
|
||||
window.addEventListener('focus', () => {
|
||||
document.addEventListener('readystatechange', () => {
|
||||
let navlinks = Array.from(document.querySelectorAll('#links a'));
|
||||
|
||||
navlinks.forEach(element => {
|
||||
|
Loading…
Reference in New Issue
Block a user