I plan to add a few decorative elements on the page using JavaScript: randomly generated triangles.
These elements are purely decorative, and I want them to be created, as if in the background, and do not interfere with the user's work with already created page elements.
Tell me, please, how can this be done?
If you just hang this function on Onload
, then, in theory, the user will not be able to really work with this page until Onload
is executed ...
setTimeout()
call once a second a f-th, adding a new triangle, until the number of triangles reaches the set threshold. - Sergiks