Day # 56: Popup



Popup’s are a very common functionality that we, as frontend developers, need to be able to create, handle and optimize. Besides, popup’s represent a good opportunity to practice to manage events in the DOM in Javascript, which is an essential skill to have.

The key here is to add an event listener on the button that opens and closes that popup in order to toggle their functionality and hence their style:


toggleBtn.onclick = function() {

    container.classList.toggle('active')

}


Once we have configured that class, then the procedure is quite straightforward since we only need to focus on how that popup should function and look.

A potential new exercise is to find another way to create that popup, since that will expand our perspective as developers in regards to always optimize a solution once we have come up with it. 


Comments

Popular posts from this blog

Day # 19: Checkbox animation

Day # 12: Typewriter Effect

Day # 53: Icon text