Hello
I’m having the same issue with a few other quirks.
site: https://www.sprangz.com/afro-care-tips
I have a Chromebook and not looking to add more apps so I hope description is enough…
I didn’t change anything substantive in the code and only used Corvid on this one page on four text boxes.
1st paragraph (text13, button1)
“Read More” button click changes text13 into text8 shortText and button remains as “Read More”; 2nd click expands text8, “Show Less” button click collapses text8 & text13 does not return
2nd paragraph (text12, button8)
All buttons coded as “Read More” but this paragraph says “Show More” and button click does not expand paragraph
3rd paragraph (text10, button6)
Same issue as 1st paragraph, text10 is replaced by text8… text10 does not return
4th paragraph (text8, button7)
Same issue as 2nd paragraph and button will not attach to shortText/text box (large space on page) but button click will expand and collapse correct text8
I checked the page code and each section looks identical and text/button IDs are correct so I have no idea how to fix this.
Thanks for your help!
let fullText; // variable to hold the full text
let shortText; // variable to hold the short version of the text
// For full API documentation, including code examples, visit http://wix.to/94BuAAs
$w.onReady(function () {
// how many characters to include in the shortened version
const shortTextLength = 452;
// read the full text and store it in the fullText variable
fullText = $w("#text13").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("#text13").text = shortText;
//TODO: write your page related code here...
});
export function button1_click(event) {
// check the contents of the text element
if ($w("#text13").text === shortText) {
// if currently displaying short text, display the full text
$w("#text13").text = fullText;
$w("#button1").label = "SHOW LESS";
} else {
// if currently displaying full text, display the short text
$w("#text13").text = shortText;
$w("#button1").label = "READ MORE";
}}
//Add your code for this event here:
$w.onReady(function () {
// how many characters to include in the shortened version
const shortTextLength = 451;
// read the full text and store it in the fullText variable
fullText = $w("#text12").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("#text12").text = shortText;
//TODO: write your page related code here...
});
export function button8_click(event) {
// check the contents of the text element
if ($w("#text12").text === shortText) {
// if currently displaying short text, display the full text
$w("#text12").text = fullText;
$w("#button8").label = "SHOW LESS";
} else {
// if currently displaying full text, display the short text
$w("#text12").text = shortText;
$w("#button8").label = "READ MORE";
}}
//Add your code for this event here:
$w.onReady(function () {
// how many characters to include in the shortened version
const shortTextLength = 607;
// read the full text and store it in the fullText variable
fullText = $w("#text10").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("#text10").text = shortText;
//TODO: write your page related code here...
});
export function button6_click(event) {
// check the contents of the text element
if ($w("#text10").text === shortText) {
// if currently displaying short text, display the full text
$w("#text10").text = fullText;
$w("#button6").label = "SHOW LESS";
} else {
// if currently displaying full text, display the short text
$w("#text10").text = shortText;
$w("#button6").label = "READ MORE";
}}
$w.onReady(function () {
// how many characters to include in the shortened version
const shortTextLength = 390;
// read the full text and store it in the fullText variable
fullText = $w("#text8").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("#text8").text = shortText;
//TODO: write your page related code here...
});
export function button7_click(event) {
// check the contents of the text element
if ($w("#text8").text === shortText) {
// if currently displaying short text, display the full text
$w("#text8").text = fullText;
$w("#button7").label = "SHOW LESS";
} else {
// if currently displaying full text, display the short text
$w("#text8").text = shortText;
$w("#button7").label = "READ MORE";
}}