Hi there,
The expandable/collapsable text box on my mobile site has an extremely large blank space between the text and the button. Interestingly, this blank space does not show up when I preview the mobile site through wix editor, only when I go to the site on an actual mobile phone-- not sure how to troubleshoot this. Anyone have tips? I added two videos – first one is of the mobile site from my iphone, second one is the mobile site preview on wix editor.
The code that I used that works great on desktop is:
let fullText; // variable to hold the full text
let shortText; // variable to hold the short version of the text
$w.onReady( function () {
// how many characters to include in the shortened version
const shortTextLength = 397;
// read the full text and store it in the fullText variable
fullText = $w(“#text19”).text;
// grab the number of characters defined in shortTextLength and store them in the shortText variable
shortText = fullText.substr(0, shortTextLength) + “…”;
// set the contents of the text element to be the short text
$w(“#text19”).text = shortText;
});
export function button7_click(event) {// check the contents of the text element
if ($w(“#text19”).text === shortText) {
// if currently displaying short text, display the full text
$w(“#text19”).text = fullText;
$w(“#button7”).label = “Show less”;
} else {
// if currently displaying full text, display the short text
$w(“#text19”).text = shortText;
$w(“#button7”).label = “Show more”;
}
}