Hi Guys,
For a long time now im searching for a code thats help me when i clicked the image a text appears on the website.
Its for a car, so when someone clicked the image color they will see the name of the color on the screen.
Thanks for the help!
J.D
2
Do you mean an image tooltip that shows up while hovering over the image or a fixed text element that with dynamic contents?
Hi,
I mean when the customer clicks on the color that he want, a text with the color name will appear next to the image.
So the customer knows what the color name is. and when he click another color the name will replace the name from previous color name.
So the image with the text next to it at the same time.
Hope you can help me with the code.
J.D
4
@jaimieheijnen14
So add a text element to the page.
Then do something like:
const images = [
{elementPropertyId: 'image1', label: 'red'},
{elementPropertyId: 'image2', label: 'green'},
{elementPropertyId: 'image3', label: 'blue'},
//etc...
];
$w.onReady(() => {
images.forEach(e => {
$w('#' + e.elementPropertyId).onClick(event => {
$w('#text1').text = e.label;
})
})
})