Skip to content
Advertisement

JS alert after all content is loaded

I need to make an alert after all content is loaded and user can see all images 100%.

I do this way – I made a function in the end of my webpage (be fore the BODY tag is closed:

JavaScript

But it doesnot work. The alert comes when some images are not loaded. Especially on mobile devices. On desktop it works sometimes

Advertisement

Answer

This will help:

JavaScript

Please check @ CodePen https://codepen.io/animatedcreativity/pen/07c67507a741a76f4ae208d52a29cf7b/

^ I have added big images for you in the example. Alert will show up only after everything is fully loaded.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement