@marlowe-shaeffer
All code below. It’s the exact same as the tutorial. The two container boxes aren’t named in the code so I thought deleting them would be okay.
I have several boxes that are all supposed to collapse. The first picture shows it in preview mode, the second shows the elements. They’re right next to each other, but they won’t move together. But, the boxes below will move together. I can’t figure it out! Nothing is in an overall container box so it can’t be that since part of it works. I think somehow they became ‘detached’ from each other, but I can’t get them back together.
function toggleFold(index) {
let $fold = $w( ‘#fold’ + index);
let $arrowDown = $w( ‘#arrowDown’ + index);
let $arrowRight = $w( ‘#arrowRight’ + index);
// toggle the fold at the index
if ($fold.collapsed) {
$fold.expand();
$arrowDown.show();
$arrowRight.hide();
}
else {
$fold.collapse();
$arrowDown.hide();
$arrowRight.show();
}
// collapse the other folds
[ 1,2,3,4,5,6,7,8 ]
.filter(idx => idx !== index)
.forEach(idx => {
$w( ‘#fold’ + idx).collapse();
$w( ‘#arrowDown’ + idx).hide();
$w( ‘#arrowRight’ + idx).show();
})
}
export function headerBox1_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
toggleFold( 1 );
}
export function headerBox2_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
toggleFold( 2 );
}
export function headerBox3_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
toggleFold( 3 );
}
export function headerBox4_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
toggleFold( 4 );
}
export function headerBox5_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
toggleFold( 5 );
}
export function headerBox6_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
toggleFold( 6 );
}
export function headerBox7_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
toggleFold( 7 );
}
export function headerBox8_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
toggleFold( 8 );
}