hellow
I want to use “roll” effect when a box elemnt is called to expand and collapse…
does it possible?
because in the API’s they say it’s for show/hide call…
this is what I wrote:
let rollOptions = {
"duration": 2000,
"delay": 1000,
"direction": "right"
};
export function sleepSec_click(event) {
if ($w('#sleepQuest').collapsed) {
$w('#sleepQuest').expand("roll", rollOptions)
} else {
$w('#sleepQuest').collapse("roll", rollOptions)
}
thank you very much!
Did you try it? If so, you’ve probably discovered that it doesn’t work. Refer to the API for collapse and you’ll see that this is not available for collapse/expand. Refer to the API for hide and you’ll see that it is available for hide/show.
so there is no othere way to animate it?
I did tried it, and I saw it’s not working, I thought maybe there is another code to make an effect on collpase/expand elements…
It’s possible to do if you both collapse and hide element by default. And before showing element, you expand it.
let rollOptions = {
"duration": 2000,
"delay": 1000,
"direction": "right"
};
export function sleepSec_click(event) {
if ($w('#sleepQuest').collapsed) {
$w('#sleepQuest').expand().then(()=>
{$w('#sleepQuest').show(rollOptions )})
} else {
$w('#sleepQuest').hide(rollOptions ).then(()=>
{$w('#sleepQuest').collapse()})
}
}
Cool - I gotta try this sometime.
I try the code but it doesn’t work for me can you explain more please?