Is it possible to save the designated element that is changing the style to in setInterval as animation gif?

Asked 1 years ago, Updated 1 years ago, 33 views

Prerequisite
·The id of the specified div is changed every period of time using setInterval

Question
·Is it possible to save the designated div drawing contents in the browser as animation gif?

Supplementary
·I don't want to use specialized tools as much as possible
·If you throw something through a script, you can get the result. API is acceptable

Assume
·Save by right-clicking
·Or save as some action in the js script
·Or save automatically after a certain period of time after loading the page

javascript

2022-09-30 20:47

1 Answers

If you draw an image on Canvas, you can get the data, create a GIF image using FileAPI, etc., and download it at any time by using download attributes of Blob and a element a.
Also, since SVG can be drawn on Canvas, any html element you want to draw under SVG foreignobject element can be built in with style applied inline and it can be achieved under certain restrictions.


2022-09-30 20:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.