Preset animated gif

I have a function in which a user can click a thumbnail of a video, and my php script will capture the video.

I have a div that displays: none; containing the code of the flash video player, and its background image is an animated gif (downloader) in css. I use the jquery show method so that it displays when the user clicks on it.

But when the div is clicked, the boot image also needs to be extracted. Since the video is also extracted at the same time, the boot image rarely appears at all.

How can I preload this image without making it part of another image using the negative field trick ???

+3
source share
1 answer

Put this javascript somewhere on the page so that it runs on load:

var image = new Image();
image.src = 'path/to/spinner.gif';
+10
source

Source: https://habr.com/ru/post/1706682/


All Articles