Après 12 mois d'abandon de mon site, je remets les mains dans le cambouis et la tête dans le javascript.
Je rencontre un
gros souci qui me rends complètement FOU (
) avec javascript:
- Une fois, ça marche,
- Une autre fois, ça marche pas!
- Ou alors une partie du code fonctionne et pas le reste . . .
C'est complètement aléatoire, (du moins, je le crois . . .)
Exemple:
Ce code à fonctionné, puis refuse sur une nouvelle page:
JS: (en Endbody)
$(function(){
$(window).scroll(function(){
$('panel1').toggleClass('fade_panel1', $(window).scrollTop() > 400 );
});
});
CSS: (en header)
.panel1 {
-webkit-transition: opacity 0.5s ease;
transition: opacity 0.5s ease;
}
.panel1.fade_panel1 {
opacity: 0;
}
J'ai tout essayé, même revenir à un état largement antérieur du projet! Rien à faire
Dans Chrome, j'ai les erreurs suivantes:
font-awesome.css Failed to load resource: the server responded with a status of 404 (NotFound)
jssocials.css Failed to load resource: the server responded with a status of 404 (NotFound)
jssocials-theme-flat.css Failed to load resource: the server responded with a status of 404 (NotFound)
scrollreveal.min.js Failed to load resource: net::ERR_NAME_NOT_RESOLVED
font-awesome.css Failed to load resource: the server responded with a status of 404 (NotFound)
jssocials-theme-flat.css Failed to load resource: the server responded with a status of 404 (NotFound)
jssocials.css Failed to load resource: the server responded with a status of 404 (NotFound)
_modele_page_.htm:1531 Uncaught TypeError: Cannot read property 'innerHTML' of undefined
(cette erreur me renvoie sur rien du tout)
at HTMLDocument.<anonymous> (_modele_page_.htm:1531)
at c (1.10.2.js?v=63614060466:formatted:1293)
at Object.fireWith [as resolveWith] (1.10.2.js?v=63614060466:formatted:1351)
at Function.ready (1.10.2.js?v=63614060466:formatted:136)
at HTMLDocument.q (1.10.2.js?v=63614060466:formatted:11)
undefined Failed to load resource: the server responded with a status of 404 (NotFound)
commentaires_focus-8.png Failed to load resource: the server responded with a status of 404 (NotFound)
241.10.2.js?v=63614060466:formatted:721 Uncaught Error: Syntax error, unrecognized expression: #.bt_commentaire.oeso-open
at Function.at.error (1.10.2.js?v=63614060466:formatted:721)
at mt (1.10.2.js?v=63614060466:formatted:1042)
at kt (1.10.2.js?v=63614060466:formatted:1216)
at Function.at [as find] (1.10.2.js?v=63614060466:formatted:491)
at HTMLBodyElement.handlers (1.10.2.js?v=63614060466:formatted:2179)
at HTMLBodyElement.dispatch (1.10.2.js?v=63614060466:formatted:2154)
at HTMLBodyElement.v.handle (1.10.2.js?v=63614060466:formatted:2042)
font-awesome.css Failed to load resource: the server responded with a status of 404 (NotFound)
jssocials.css Failed to load resource: the server responded with a status of 404 (NotFound)
jssocials-theme-flat.css Failed to load resource: the server responded with a status of 404 (NotFound)
Cela fait une semaine que j'essaie de trouver pourquoi les codes JS ne répondent pas.
J'en cauchemarde la nuit
Qui aurait une piste ?