From 5c67e5b5897b7e9342e458e1e04969ac9517fe12 Mon Sep 17 00:00:00 2001 From: Divlo Date: Sat, 7 Dec 2019 09:46:33 +0100 Subject: [PATCH] Hotfix : widthWindowChange() on window.onload --- scripts/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/main.js b/scripts/main.js index 1f07f0f..4cbb663 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -231,7 +231,7 @@ $(function () { } /* Changement du logo du header selon la largeur de la fenêtre */ - $(window).resize(function() { + function widthWindowChange() { const windowWidth = $(window).width(); if(windowWidth < 463){ $('#logo-header').attr('src', '/img/FunctionProject_icon.png'); @@ -243,10 +243,12 @@ $(function () { $('#logo-header').removeAttr('style'); $('.navbar-brand').removeAttr('style'); } - }); + } + $(window).resize(widthWindowChange); + widthWindowChange(); /* Permet d'afficher l'heure en temps réel sur le footer */ - window.onload = realDateTime('realDateTime'); + realDateTime('realDateTime'); /* Window Scroll Top Button */ const $btnScrollTop = $('.scroll-top-arrow');