Linking Dynamic Page items on Lightbox

Hi, I really need your help after a few hours I work with code.

I have a dynamic page and after 2 sec, it will automatically show a lightbox. In the lightbox I want show some elements which have same item as in the dynamic page.

I tried export function, but it will works only if I have button clicked. So, what I must to use in my code?

I’m really thank you of someone can help me

Get the required info from the page and pass it to the lightbox when it opens.
https://www.wix.com/corvid/reference/wix-window.lightbox.html

How do I pass data between a page and a lightbox?
When you open a lightbox using the openLightbox() function, you can pass an object containing data to be used in the lightbox. In the lightbox’s code, you call the getContext() function to retrieve the data sent by the openLightbox() function.

When you close the lightbox using the close() function, you can pass an object containing data to be used by the page that opened the lightbox. This data is retrieved from the resolution of the Promise returned by the openLightbox() function.

I have done similar for a test example of sending an image from a table to a lightbox.
https://givemeawhisky.wixsite.com/radiobuttonexample/imagetest

Page code.

import wixWindow from 'wix-window';

$w.onReady(function () {
});

export function table1_rowSelect(event) {
wixWindow.openLightbox("ImagePhoto",event.rowIndex);
}

Lightbox code.

import wixWindow from 'wix-window';

$w.onReady(function () {
const dataFromTableRow = wixWindow.lightbox.getContext();
$w('#dataset1').setCurrentItemIndex(dataFromTableRow)
.then(() => {
const currentItem = $w('#dataset1').getCurrentItem();
$w('#image1').src = currentItem.imagePic;
$w("#image1").tooltip = currentItem.title;
$w("#image1").alt = currentItem.title;
});
});

Previous forum posts will help here too.
https://www.wix.com/corvid/forum/community-discussion/dynamic-page-lightboxes
https://www.wix.com/corvid/forum/community-discussion/lightbox-with-dynamic-content-via-button

Thank you for your respond, but I still confuse how to write these code. This is my code:

Code on my dynamic page :

import wixWindow from 'wix-window';

$w.onReady(function () {
    wixWindow.openLightbox("Penawaran", {
 "pageSend1": $w('#text33').text,
 "pageSend2": $w('#image33').src
  });

Code on my Lightbox:

import wixWindow from 'wix-window';

$w.onReady( function () {
 let received = wixWindow.lightbox.getContext();
  $w('#text295').text = received.pageSend1;
  $w('#image29').src = received.pageSend2;
} );

It worked to open lightbox, but #text295 and #image29 don’t show item like on dynamic page (#text33 and #image33).