getContext( )


Returns the data object that was passed to a lightbox.

について getContext() function returns the data object passed when the lightbox was opened using the openLightbox() function, if any data was passed. If the lightbox was opened another way, getContext() returns undefined.

To pass data to the lightbox that is opened, you must open the lightbox programmatically using the openLightbox() function. If the lightbox is opened automatically when the page loads or by a link from a page element, data will not be passed to the lightbox. Therefore, if you want to pass data to the lightbox, make sure Automatically display lightbox on pages is set to いいえ in the Lightbox Settings panel in the Editor and don't set any element's link to open the lightbox. Instead, create your own method for opening the lightbox programmatically. For example, you can add a button with an onClick event handler that calls the openLightbox() 関数である。

メソッド宣言
コピー
リクエスト
このメソッドはパラメータを取らない
リターン
Return Type:Promise<object>
役に立ちましたか?
はい
いいえ