Hoping someone can help me. I am using 2 elements on my page, a themed box with 4 buttons in it, and a multi-state box. Each of the buttons in my themed box changes the state in the multi-state box when clicked. My themed box is on the left-hand side of the page and the multi-state box is on the right. What I want to achieve is this: when a visitor lands on the page I want box boxes to be in the center of the page, with the multi-state box hidden underneath the theme box. Clicking any of the buttons should reveal the multi-state box and arrange both boxes as I described before, theme on the left, multi-state on the right. Kinda like sliding doors opening either way. This effect only has to happen once - the first click of any of the 4 buttons in the themed box.
I’ve searched everywhere I can think of searching, but haven’t been able to find any code that can do this. I guess combining snippets of code would probably get me there, however combining code is not one of my strengths. If anyone could point me in the right direction I would really appreciate it.
Hi, Dean!
I think you can use hide/show() for that.
You can create three elements:
- box in the center - themed box; Let’s say it’s name $w(“#initialBox”)
- box on the left-hand - themed box (hidden on load). $(“#themedBox”)
- box on the write hand - multi-state (hidden on load) $(“#multiStateBox”)
All buttons inside the themed box have the same event.
Something like this:
function showBoxesOnClick() {
$w("#initialBox").hide();
$w("#themedBox, #multiStateBox").show();
}
Hi Viktoriia,
Thank you very much!! Exactly what I wanted.