articleBody
| -
And this is my JS code and live preview . Only points to highlight
in my code comparing to the solved one by chris are:
I used addEventListener instead of using the event
handler as property. Being able to remove the listeners was what
made me decide for it (even if it didn’t matter at this early
stage ).
Because of the previous point, I didn’t code the
displayImage function specified in the guidelines. It
was going to be only one line in there, and I was already using
event function handlers. Too many functions for something that
simple. But, I was able to see that setting up
displayImage allow us to used it in a wide different
set of events in case we want to improve our gallery; i.e. dragging
a file to the page, display such picture and show another thumbnail
at the bottom.
I loved this assessment! it was challenging. I’m going to read
again the “Introduction to events” section as well as the
external links in there. I felt like it was a stepped curve of
learning.
-
@Paul_Harris
Unfortunately your code is no longer available, so I can’t see
what you had made. In the guidelines, think Chris gave us a hint
with “event” and “target” and suggested us to use Event objects as is explained in the
course, or at least that’s what I used (haven’t checked the
solved code).
-
And this is my JS code and live preview . Only points to highlight
in my code comparing to the solved one by chris are:
I used addEventListener instead of using the event
handler as property. Being able to remove the listeners was what
made me decide for it (even if it didn’t matter at this early stage
).
Because of the previous point, I didn’t code the
displayImage function specified in the guidelines. It
was going to be only one line in there, and I was already using
event function handlers. Too many functions for something that
simple. But, I was able to see that setting up
displayImage allow us to used it in a wide different
set of events in case we want to improve our gallery; i.e. dragging
a file to the page, display such picture and show another thumbnail
at the bottom.
I loved this assessment! it was challenging. I’m going to read
again the “Introduction to events” section as well as the external
links in there. I felt like it was a stepped curve of learning.
|