Remove a popup when we click for the 2nd time.

0
Hello,  I am lookingfor a way to remove a popup when I click on the icon for the 2nd time (as you can see in a Google page) At the moment in the navigation bar, I put an icon.  When I click on this icon for the first time,  a popup will appear.  After clicking for the 2nd time, the popup will reappear. I would like that it will be removed for the 2nd time. I used the HTML snippet and I put this Javascript code. I have no success.   May you help me?     “$(".mx-navbar-item").click(function(){     if($('.HomeWebPopUp').css('display') == 'block')     {         $('.HomeWebPopUp').remove();     }     }); $(".ClosePopUpOnClick").click(function(){     $('.HomeWebPopUp').remove(); });”
asked
2 answers
0

change the CSS  property of the main container to

display: none

 

answered
0

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.

 

https://appstore.home.mendix.com/link/app/108838/

answered