Hello,
I added collapsible boxes to one of my pages. Titles are always shown and clicking on a title reveals text under it (clicking again resets it back to the original state). The text is originally hidden.
It works on the desktop version but not on mobile: on mobile, by default, there is space for the text below each title, and clicking the title removes that space. Re-clicking resets to the base state.
What am I doing wrong?
The webpage is https://asturion.wixsite.com/my-site-3 and the source code is as follows:
$w.onReady(function () {
$w('#someIdCollapseButton').onClick (() => {
// one call to toggleBox per title.
toggleBox($w('#someIdCollapsibleStrip'),
$w('#someIdPlusSign'),
$w('#someIdMinusSign')) ;
});
// others calls to toggleBox
// ...
});
function toggleBox(boxElement, plusSign, minusSign) {
const isCollapsed = boxElement.collapsed;
if (isCollapsed) {
plusSign.hide();
minusSign.show();
boxElement.expand();
} else {
minusSign.hide();
plusSign.show();
boxElement.collapse();
}
}
Thank you!