| JavaScript Document (8) Events (8) ExtJS (5) Strings (3) |
How can I execute javascript code when an image is loaded?
(1 votes). Leave comments and/ or rate it.
Question: I need to display a certain part of my page after a big picture is loaded. How can I catch this event?Answer: This can be done easily with the onload and onerror event handlers that all IMG elements have. In those handlers you can check whether the images is loaded by reading the complete property.Here's an example for images with event handlers:
Comments:
|