0
Animation with setInterval()
I want to insert classes into each class using the setInterval () list every 300 milliseconds, but what happens is that the error helps me to solve this error and do you have any other way better than what I made? https://code.sololearn.com/WiVqJkLOXbF1/?ref=app
7 Antworten
+ 2
I guess I'm not really understanding your design goals for this snippet and I only understood the first part of your post. What do you want the code to do?
+ 1
I'm not really understand the code so.
However there are some errors I noticed, querySelector return a single element, not an array. Maybe you should use querySelectorAll which return all the assigned elements.
Other issues are
The index of the array is not initialize before use.
And the index does not reset based on the array length, would be runtime error when timer increase the index larger then the array length.
0
Janning⭐ I want when the hide menu button is clicked then enter the transhide class into each div that has a class list-menu every 300 millisecond but that doesn't work and results in erorr
0
Not sure if I got what you mean, but here's what I'm picking up:
https://www.newmediacampaigns.com/blog/nicer-navigation-with-css-transitions-part-2
(see the View Demo link)
0
I want to make menu animations like my code
https://code.sololearn.com/Ws4bJXu1Mgu6/?ref=app in this code I use animation-delay on css but in this case I want to give animation-delay in javascript using setInterval ()
0
Nifty. :)
So you weren't really looking for "any other way better", you're looking specifically to use setInterval()?
0
nor if there are other better ways I will use them and I learn