change the CSS property of the main container to
display: none
when you click on the buttom you can add a class to the popup “open”
this way clicking ont he button will just add the class so that's no problem.
unless you want it to toggle, than it will add/remove the class.
this widget might also help if you want to do it all in mendix.