Costa Michailidis
Costa Michailidis

Reputation: 8178

Faster image changing in JS

I have an audio player I built with HTML5 and JavaScript.

Clicking on the play button tells JavaScript to play the audio and change the src on the play button image (play.svg) to the pause.svg icon. The slowness here is noticeable. Takes time to go to the server and fetch that image.

What's a faster way to change the play button to a pause button?

Upvotes: 0

Views: 447

Answers (1)

csilk
csilk

Reputation: 2932

The question is quite broad, but to give you some ideas:

Without seeing your code I don't know what the best solution for you is but one of these options should cover what you are looking for.

Upvotes: 4

Related Questions