Is there anything worng with this coding? There is just awkward spacing between the button and the text.
let fullText5; // variable to hold the full text
let shortText5; // variable to hold the short version of the text
$w.onReady( function () {
// how many characters to include in the shortened version
const shortText5Length = 235;
// read the full text and store it in the fullText variable
fullText5 = $w(“#text67”).text;
// grab the number of characters defined in shortTextLength and store them in the shortText variable
shortText5 = fullText5.substr(0, shortText5Length) + “…”;
// set the contents of the text element to be the short text
$w(“#text67”).text = shortText5;
});
export function button18_click(event) {
//Add your code for this event here:
if ($w(“#text67”).text === shortText5) {
// if currently displaying short text, display the full text
$w(“#text67”).text = fullText5;
$w(“#button18”).label = “Show less”;
} else {
// if currently displaying full text, display the short text
$w(“#text67”).text = shortText5;
$w(“#button18”).label = “Show more”;
}
}
also, how to I make a collasped page body too?