I’m trying to include an image on pause and play. This is of it working without images. I can’t seem to get it to work adding images to pause and play. This is how it works without images, after I include images it doesn’t work. https://jsfiddle.net/y6Lh5svh/6/
As a wild guess, it feels like you’d be better off using the JS to change the class on the element, and then reference each of the classes in your CSS, which will have the reference to the appropriate background image in it.
That’s a good idea. The only trouble is that his code is getting far too complex to understand easily, so people will be less likely to want to take the time to try and understand what’s going on there.
This happens because of inline JS as you can’t use e.g. double quotes for the surrounding quotes. Of course, as @chrisofarabia said, even better would be to apply classes. Here’s a basic example:
Because you’re using inline styles and JavaScript and this is immediately getting far too confusing to debug. I think the quotes I mentioned above are the main issue here, an error directly caused by inline JS.
It starts off red, doing nothing else.
When the red square is clicked, it goes black and nothing happens.
Then then when the black square is clicked it gets a blue border and plays.
That doesn’t seem like it’s supposed to work that way. What do the colors mean? Are you sure it’s supposed to behave that way?