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!
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()}) } }
I try the code but it doesn't work for me can you explain more please?
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.