INHOUDSOPGAVE
![](https://cdn.prod.website-files.com/5c2a9a234fdbba7439c48fa4/656600ac15e8fb306ae8447f_TQW0N2GV8-U064G7QV42G-g1e8a2ba916b-512.webp)
Ovidiu
This post will teach you how to Hide a Popup for a Set Period of Time in Webflow and when/why you might want to Hide a Popup for a Set Period of Time in Webflow in your project.
How to Hide a Popup for a Set Period of Time in Webflow
Memberscripts needed
https://www.memberstack.com/scripts/91-hide-popup-for-set-duration
Tutorial
Cloneable
![](https://cdn.prod.website-files.com/5c2a9a234fdbba7439c48fa4/65fb0290014dcda272d85848_Screenshot%202024-03-20%20at%2016.36.33.webp)
Why/When would need to Hide a Popup for a Set Period of Time in Webflow?
- Hide an element such as a popup when another element is clicked – e.g. hide a popup if a form is filled out.
You may sometimes want to hide certain elements of your page such as popups for a certain amount of time if your visitors interact with another element on your page.
This might be because that element has now become irrelevant or simply to improve the user experience by hiding that element once visitors choose to hide it.
This guide will show you a quick and easy way to do just that by using the example of a Google sign-in popup. Once visitors close this popup, it will stay closed for one hour even if they refresh the page.
Hiding a popup for a set period of time in Webflow
To hide a popup for a set period of time on a Webflow site, we’re going to use MemberScript #91 – Hide Popup for Set Duration. Follow the link to get the code you’ll need to add to your page and watch a video tutorial on how to set everything up.
Setting it up
The first thing you’ll need to do is create the trigger element – in our case it will be an X in the corner of the popup. Once that’s done, add the following attribute to the element’s wrapper:
- ms-code-hide-popup=”button”
Next, you’ll need to add the following attribute to the element that you want to hide:
- ms-code-hide-popup=”0:1:0:0”
The first number represents the number of days, then hours, minutes, and seconds. In our example, the element will stay hidden for one hour.
Making it work
Now that you’ve got your trigger element and you’ve added the appropriate attributes, all you need to do is add the MemberScript #91 custom code to your page, before the closing body tag.
If you’re already using jQuery elsewhere, you can delete the first line of the custom code.
![A black screen with white textDescription automatically generated](https://cdn.prod.website-files.com/5c2a9a234fdbba7439c48fa4/65fb0218fb7072a624366d44_876kFJ0vOguBmPb8cQXQkVOIWRyogkx2PWjjNSOHNwVI9BwLl9pe-lr8x-x4H3OPu34nljg5SPHqivNRxfDjt0xf5IlfXVVuwphOuoejvHPBr8Xj6zfpFMQrbXntrQyRAOBKQLAtxnAyKRv4mpTXP_Q.webp)
Conclusie
That’s everything, you can now go ahead and test your disappearing element on your live site.
If you want to use our demo project to get you started, just click the button below to add it to your Webflow site.
![](https://cdn.prod.website-files.com/5c2a9a234fdbba7439c48fa4/65fb0218c6d1637c26c36dd2_UeK-NbHBxkGxo7uk905DY845ebwxpJC3k3LEqXm8rRkbvCtsVwMrGWqd0K7TNKC6BAQieq4mOfCHrjboLj2HA6R43ePNI6C574y6DSc5pj2wI0kqKpl2vGf2T8bks13jR_Xg-Hkue2edt5Wei-YCQB0.webp)
Our demo can help you add a popup that stays hidden for a set amount of time once users close it.