Dear all,
I’m working on my website and want to open a lightbox with a custommade-button (my image) from out of a repeaterbox. The data is connected through the dataset and is publicing my custommade buttons as should.
In the page code, I have added the following code:
import wixWindow from 'wix-window';
$w.onReady(() => {
$w("#dataset1").onReady(() => {
$w("#repeater1").onItemReady(($item, itemData, index) => {
$w("#image28").onClick( (event) => {
let toolTipText = $w("#image28").tooltip;
wixWindow.openLightbox(toolTipText)
} );
} );
} );
} );
‘Dataset 1’ is the dataset
‘repeater1’ is the repeater that places all the images and texts (image → icon, text → icon text)
‘#image28’ is the standard image that will be replaced by the repeater (image source → icon, alt text → title, tooltip → lightbox)
The image its tooltip is connected through the dataset and the result is visible as showing the text onscreen. The tooltip is filled with the exact name of the lightbox I want to open.
Could some of you please shine a light on my code as I cannot find out how to use the tooltip text from the resulting image correctly, getting it to be used as a string in ‘openLightbox’? I have already tested my code with a static image on the page, which works flawlessly. Getting the tooltip information of out an dynamic image to an useable string however did give me some extra grey hairs.
Thanks in advance for any comment.