I’m a bit confused by the mix of click actions with mouseIn and mouseOut actions. You originally described hovering over an image and having some text appear. You didn’t mention clicks. I don’t know the relationship among all the elements, so I don’t know if the click and hover interactions might be interfering with one another.
To get some clarity, I put together a simplified example of what I thought you were originally trying to accomplish – and made it work.
Here’s the original state – a pair of photos, side by side. No text appears.
When I hover over the photo on the left, matching text appears and the photo grows a bit larger:
And when I hover over the photo on the right, matching text appears and the photo grows a bit larger.
The change in the photo size was simply a hover interaction – no code required – so lets ignore that (other than to say that the photos are in containers, because hover actions must be applied to containers).
As for the text, here’s the layout. The two text boxes are in a container that’s got a two-row grid. One text box appears in each row. Each row is set to fit its content and will collapse when the content collapses.
And here’s the code.
let fadeOptions = {
"duration": 1000,
"delay": 0
};
export function leftPhoto_mouseIn(event) {
$w("#leftBox").expand();
$w("#leftBox").show("fade", fadeOptions)
}
export function leftPhoto_mouseOut(event) {
$w("#leftBox").hide();
$w("#leftBox").collapse()
}
export function rightPhoto_mouseIn(event) {
$w("#rightBox").expand();
$w("#rightBox").show("fade", fadeOptions)
}
export function rightPhoto_mouseOut(event) {
$w("#rightBox").hide();
$w("#rightBox").collapse()
}
Using this example, can you explain where the clicks come into play? Or can you tell me what I’ve misunderstood about what you’re trying to do.
btw, @medtrade-kaiser, as I mentioned in my first post, this is really a question you should post on the Velo forum, because that’s where the coding experts hang out. I’m just learning, and while it’s interesting for me to work on your problem, I’m not your best resource.
On the positive side, however, maybe I can help you clarify your questions so you get better answers from the experts. They can’t help much if your problem isn’t clearly defined.