Fix mistake with readystatechange event
This commit is contained in:
parent
6f945e72f3
commit
25c5007a09
14
js/ui.js
14
js/ui.js
@ -4,7 +4,7 @@
|
|||||||
let homeRE = new RegExp(/(https?:\S+\/$|index.html$)/);
|
let homeRE = new RegExp(/(https?:\S+\/$|index.html$)/);
|
||||||
|
|
||||||
if (homeRE.test(window.location.href)) {
|
if (homeRE.test(window.location.href)) {
|
||||||
window.addEventListener('load', () => {
|
document.addEventListener('readystatechange', () => {
|
||||||
let nextimage = 0;
|
let nextimage = 0;
|
||||||
let header = document.querySelector('header');
|
let header = document.querySelector('header');
|
||||||
slider();
|
slider();
|
||||||
@ -76,11 +76,10 @@ window.addEventListener('scroll', event => {
|
|||||||
nav.classList.remove('bg-white', 'border');
|
nav.classList.remove('bg-white', 'border');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
/**
|
||||||
window.addEventListener('load', () => {
|
* Show horizontal nav on mobile
|
||||||
/**
|
*/
|
||||||
* Show horizontal nav on mobile
|
document.addEventListener('readystatechange', () => {
|
||||||
*/
|
|
||||||
let menu = document.querySelector('i');
|
let menu = document.querySelector('i');
|
||||||
|
|
||||||
menu.addEventListener('click', () => {
|
menu.addEventListener('click', () => {
|
||||||
@ -123,7 +122,6 @@ window.addEventListener('load', () => {
|
|||||||
|
|
||||||
a.addEventListener('click', () => {
|
a.addEventListener('click', () => {
|
||||||
aNodes.forEach(n => {
|
aNodes.forEach(n => {
|
||||||
|
|
||||||
if (n.src) {
|
if (n.src) {
|
||||||
let vStr = n.src
|
let vStr = n.src
|
||||||
.substr(n.src.lastIndexOf('/')+1, n.src.length)
|
.substr(n.src.lastIndexOf('/')+1, n.src.length)
|
||||||
@ -153,7 +151,5 @@ window.addEventListener('load', () => {
|
|||||||
overlay.addEventListener('click', () => {
|
overlay.addEventListener('click', () => {
|
||||||
modal.classList.remove('active');
|
modal.classList.remove('active');
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user