I'm new in javascript and php.
My body page has a link of a background image.
I have a div (div.loader
) and in my js code, I have a variable var countdown = 15
.When my countdown is 0, it will add a class loaded
to my div but I don't know how long the image will load and also the images load so slow (for me).
So I want to call a function that will add a class loaded
if the image loaded completely. (here's the link of my website loader: acromix.net16.net)
How do I call a function after the background image loads using javascript or php? (no extensions or plugins)
(This might be a duplicate but this link (jquery,plugins) is not answering my question)