top of page

Popup Custom

Create a lightening fast custom popup using a simple container

Untitled (800 x 600 px) (1).png

Lightbox Show Hide

Popup Custom

Ecom Add To Cart

Dataset Search

Dynamic Pages Previous Next

Dynamic Pages Show Hide Element

Forms Save Progress

Dataset Sort

Show Hide Elements

Dataset Pagination

All Snippets

There are use cases where a lightbox may not be suitable for the job and its too heavy and slow. This snippets give you freedom to design custom popups using containers and open them on click of a button. Advantage of these popups are they don't take ages to load.


How to setup

  • create custom popup using a container

  • set a button to open the popup

  • create a button to close the popup

  • set the container to hidden

Form feature 

If you have a Wix Form old or new version, you can provide the form id to close the popup on submission of the form. Eg. You create a newsletter form in the popup, once user submits the form, the popup closes.


Feel free to request more features on this snippet.

New to our site? Please see our quick tutorial on how to work with our snippets

View tutorials

Setting
Description

$w.onReady(function () {
PopupCustom({
containerId: '#box106',
buttonOpenId: '#button1',
buttonCloseId: '#button2',
})

PopupCustom({
containerId: '#box107',
buttonOpenId: '#button6',
buttonCloseId: '#button5',
})

PopupCustom({
containerId: '#box108',
buttonCloseId: '#button7',
openOnPageLoad: true
})

});

function PopupCustom({containerId:o,buttonOpenId:n=null,buttonCloseId:e=null,formId:t=null,closeDelay:i=0,openOnPageLoad:l=!1}){
if(!o)return;const u=$w(n),d=$w(e),s=$w(o),c=$w(t);let r="hide",m="show"
;if(s.collapsed&&(r="collapse",m="expand"),!s.id)return;l&&s.show()
;const a=()=>setTimeout((()=>s[r]()),1e3*i)
;if(u.id&&u.onClick((()=>s[m]())),d.id&&d.onClick((()=>s[r]())),c.id){
const o=c.onWixFormSubmitted||c.onSubmitSuccess,n=c.onWixFormSubmittedError||c.onSubmitFailure
;o(a),n(a)}}

Title

Title

bottom of page