When I made the decision to move from Canada to Germany I did not think about the hard work and time I would have to put in to learn the language. When I made the decision, I didn’t fully understand the gravity of learning a new language in your mid twenties at all. I could have never imagined that I would be learning two new languages at once, never mind three or four.
Since my move overseas I have set out to learn as many as (but not limited to) five new languages. Yes, you read it correctly, FIVE new languages. I moved to this side of the Atlantic holding a Bachelor’s degree in Fine Arts (Emily Carr University 2014), which some of you may know, can make it a bit difficult to always find a consistent job. In Canada I had difficulty finding a job in the creative industry without any official experience. Naturally, I was nervous that I would have the same struggles in Germany. Thankfully after a couple of months I ended my search by starting as a Junior Web Designer at CAPAHILL.
That is precisely how I felt the first time I was challenged with building my own modal. For those of you who don’t know, a modal is a box that pops up on the screen above the main content of the website. Most times, the user must first click a button that opens the modal, this modal usually displays information related to this button and then the user may close the modal. It is very common that there is also a closing button for the modal, for instance a small ‘x’ in the top right corner. I added the small ‘x’ to my modal, but I also wanted the user to be able to close the modal by clicking outside of it and essentially on top of the main content of the website.
Now onto the ‘outside click’. Finally, I was able to add an event listener that could understand if the user clicked anywhere outside of the modal or the ‘x’ button. That sentence was much easier to type then it was to realize. I spent far too many hours (5+) racking my brain, digging for an answer of how to pinpoint this specific action. Thank goodness for the world wide web, the resources are endless. I read many threads of people just like me asking questions almost like mine and was ultimately able to narrow down what I needed to do to achieve my goal.
You can read a more in depth tutorial about my first modal here!