Reputation: 61
I got a trouble with this code ; I want to added other images that I commented with comment including my name but It doesn't work , this is the original link of the code snippet
https://codepen.io/suez/pen/wMMgXp
This is the modified snippet https://codepen.io/ahmedch1/pen/BXReBN I get always this error
{
"message": "Uncaught TypeError: Cannot read property 'classList' of null",
"filename": "https://stacksnippets.net/js",
"lineno": 1179,
"colno": 25
}
You can run the code snippet above in order to get more details Thanks in advance
This modification is after being solved thanks to @slientw
https://codepen.io/ahmedch1/pen/BXReBN
Upvotes: 1
Views: 1930
Reputation: 4885
On the example provided, the script is expecting to have the same number of fnc-nav__bgs
as slides.
So, if you add 2 more divs inside div.fnc-nav__bgs
on line 163 of your HTML, it works correctly.
Example:
<div class="fnc-nav__bgs">
<div class="fnc-nav__bg m--navbg-green m--active-nav-bg"></div>
<div class="fnc-nav__bg m--navbg-dark"></div>
<div class="fnc-nav__bg m--navbg-red"></div>
<div class="fnc-nav__bg m--navbg-blue"></div>
<div class="fnc-nav__bg m--navbg-blue"></div> <!-- Added -->
<div class="fnc-nav__bg m--navbg-blue"></div> <!-- Added -->
</div>
Upvotes: 3