Hi there!
Any idea how I can solve this?:
I designed this About page which includes two toggle Show More / Show Less buttons. They work but the bottom of the page (before the footer) shows a huge gap when the buttons are showing Show More.
All the gaps between the different elements are minimal and they all move together with the toggle so that doesn’t seem to be the problem.
Here’s a link to the page https://www.sandfantasy.com/about and below is my code:
let fullTextone; // variable to hold the full text
let shortTextone; // variable to hold the short version of the text
let fullTexttwo; // variable to hold the full text
let shortTexttwo; // variable to hold the short version of the text
$w.onReady( function () {
// how many characters to include in the shortened version
const shortTextoneLength = 280;
// read the full text and store it in the fullText variable
fullTextone = $w(“#text128”).text;
// grab the number of characters defined in shortTextLength and store them in the shortText variable
shortTextone = fullTextone.substr(0, shortTextoneLength) + “…”;
// set the contents of the text element to be the short text
$w(“#text128”).text = shortTextone;
const shortTexttwoLength = 280;
// read the full text and store it in the fullText variable
fullTexttwo = $w(“#text134”).text;
// grab the number of characters defined in shortTextLength and store them in the shortText variable
shortTexttwo = fullTexttwo.substr(0, shortTexttwoLength) + “…”;
// set the contents of the text element to be the short text
$w(“#text134”).text = shortTexttwo;
});
export function button5_click(event) {
// check the contents of the text element
if ($w(“#text128”).text === shortTextone) {
// if currently displaying short text, display the full text
$w(“#text128”).text = fullTextone;
$w(“#button5”).label = “Show less”;
} else {
// if currently displaying full text, display the short text
$w(“#text128”).text = shortTextone;
$w(“#button5”).label = “Show more”;
}//TODO: write your page related code here…//Add your code for this event here:
}
export function button6_click(event) {
// check the contents of the text element
if ($w(“#text134”).text === shortTexttwo) {
// if currently displaying short text, display the full text
$w(“#text134”).text = fullTexttwo;
$w(“#button6”).label = “Show less”;
} else {
// if currently displaying full text, display the short text
$w(“#text134”).text = shortTexttwo;
$w(“#button6”).label = “Show more”;
}//Add your code for this event here:
}