1
I need a Javascript code that searches all tags img
with class load
and insert the function onload="loader(this)"
.
The idea in this is that all images with the class load
receive the function of onload
that will change the value of src
by the image value.
Would work as a plugin Lazy load, but without Apis.
If there is already something of the type here indicate me the link because I could not find something of the type.
In pure javascript, or using some library, such as jQuery?
– Miguel Angelo
But the
onload
won’t run only when the image is already loaded? How can this be a Lazy load? (And if you’re thinking about remove thesrc
, then theonload
will never perform - as the "image loaded" event will not fire until it is actually loaded...)– mgibsonbr
Jose, the way to mark a question as "solved" is to choose an answer and mark it as correct. Or publish your own solution, citing the answers that helped, and mark this as correct.
– brasofilo