openModal( )


Opens a modal window that displays the specified web page.

A modal window displays the page specified by the url property over your current page. Unlike a lightbox, which is opened by calling the openLightbox() method, a window opened by openModal() is not part of a site's structure.

Only one modal window can be open at any given time. Therefore, opening a modal window closes an already open modal window if there is one.

Note: The specified url must be an HTTPS URL.

Method Declaration
Copy
function openModal(url: string, options: OpenModalOptions): Promise<void>;
Method Parameters
urlstringRequired

The URL of the page to show in the modal window.


optionsOpenModalOptionsRequired

Modal window options.

JavaScript
import wixWindowFrontend from "wix-window-frontend"; // ... wixWindowFrontend.openModal("https://en.wikipedia.org/wiki/Wix.com", { width: 750, height: 500, });
Errors

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

Did this help?