diff --git a/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/solution.md b/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/solution.md new file mode 100644 index 00000000..4b8fe50b --- /dev/null +++ b/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/solution.md @@ -0,0 +1,6 @@ + +The algorithm: +1. Make `img` for every source. +2. Add `onload/onerror` for every image. +3. Increase the counter when either `onload` or `onerror` triggers. +4. When the counter value equals to the sources count -- we're done: `callback()`. diff --git a/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/solution.view/index.html b/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/solution.view/index.html new file mode 100644 index 00000000..bc7ff3c4 --- /dev/null +++ b/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/solution.view/index.html @@ -0,0 +1,54 @@ + + +
+ + + + + + + + diff --git a/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/source.view/index.html b/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/source.view/index.html new file mode 100644 index 00000000..6280adb4 --- /dev/null +++ b/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/source.view/index.html @@ -0,0 +1,43 @@ + + + + + + + + + + + diff --git a/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/task.md b/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/task.md new file mode 100644 index 00000000..bc742ab1 --- /dev/null +++ b/2-ui/3-event-details/11-onload-onerror/1-load-img-callback/task.md @@ -0,0 +1,36 @@ +importance: 4 + +--- + +# Load images with a callback + +Normally, images are loaded when they are created. So i when we add `