close( )


Closes a popup.

Note: The terms popup and lightbox refer to the same element. While the editor and dashboard now refer to it as a popup, the API methods continue to use the term lightbox for backward compatibility. The documentation uses both terms accordingly.

The close() method closes a popup and allows you to pass data from the popup to the page that opened the popup. If a popup is closed through the 'X' icon, close button, or popup overlay, data will not be returned to the original page.

To ensure data can be passed:

  1. Call this method to close a popup programmatically. For example, add a button with an onClick event that calls close().
  2. Disable these closing options in the popup's settings under Set Triggers.
Method Declaration
Copy
Method Parameters
dataData

The data to pass back to the openLightbox() method.

Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?