0
What's wrong with my code?why is it showing "cannot set properties of null ?
Please check and help https://code.sololearn.com/W2QZeSlLzQ1c/?ref=app
6 Réponses
+ 2
Akanksha Raundal
You can put all your JavaScript code inside the yourCode function.
Also you can name yourCode function to any name you want.
+ 6
// Scroll Reveal distance in px is not responsive. Better way as follows:
const sr = ScrollReveal ({
origin: 'top',
distance: '4rem',
duration: 2000,
reset: true
});
+ 5
window.onload = yourCode;
function yourCode() {
// Your code goes here
}
Making sure to load html elements first, then interacting with them in JavaScript, otherwise they return null as if they don't exist.
+ 4
Akanksha Raundal
here I have the question answered why happed that and how is the solution:
https://sololearn.com/discuss/3248907/?ref=app
0
Can you both please apply your edits in the code ? Pleased cuz I am not able to understand where to put those codes. Please 🙏
0
TYSM!