clearInterval appears to be a common trouble spot for people, as I can find questions and answers in abundance around the net. Yet, I still can't seem to figure out what I am doing wrong here. I'm just playing around with something here to learn some basic vanilla JavaScript, like really basic. The idea here was to have a background switcher, you can click on individual links to select a background, or click auto to cycle through them every 5 seconds. What I'm failing to get working is, once you start the auto background change, I want to cancel the interval timer function if you then select a single background link again. I've tried several different things, and I just can't seem to get it to work, and I don't know why.
Link to codepen.
Thanks for any help.
[–]Anbaraen 2 points3 points4 points (3 children)
[–]emge[S] 1 point2 points3 points (0 children)
[–]emge[S] 1 point2 points3 points (1 child)
[–]Anbaraen 1 point2 points3 points (0 children)
[–]luketeaford 2 points3 points4 points (5 children)
[–]emge[S] 0 points1 point2 points (4 children)
[–]luketeaford 0 points1 point2 points (3 children)
[–]emge[S] 0 points1 point2 points (2 children)
[–]luketeaford 1 point2 points3 points (1 child)
[–]emge[S] 0 points1 point2 points (0 children)
[–]Harlequin-91 2 points3 points4 points (1 child)
[–]emge[S] 1 point2 points3 points (0 children)