подпишись на нашу рассылку или расскажи о своих идеях
Важно! Отправляя свои данные на регистрацию, ты соглашаешься
с условиями хранения и обработки персональных данных (смотреть).
let fullText; // variable to hold the full text
let shortText; // variable to hold the short version of the text
// За полной документацией по API, включая примеры кода, зайдите на http://wix.to/94BuAAs
$w.onReady(function () {
// how many characters to include in the shortened version
const shortTextLength = 233;
// read the full text and store it in the fullText variable
fullText = $w("#text48").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("#text48").text = shortText;
});
//TODO: write your page related code here...
export function button9_click(event) {
// check the contents of the text element
if ($w("#text48").text === shortText) {
// if currently displaying short text, display the full text
$w("#text48").text = fullText;
$w("#button9").label = "свернуть";
} else {
// if currently displaying full text, display the short text
$w("#text48").text = shortText;
$w("#button9").label = "читать далее...";
}
}