Sorry I'm really new to building websites, so these questions might be quite basic. I've been struggling without much success with simple Wix Codes over the past few days, and would deeply appreciate any advice from the experienced folks here! Specific Question: I'm struggling with making an expanding and collapsing text box. When I follow the help instructions, I can see that my text is hidden. However, the button to "view more" does not work - I get a prompt that says: "Loading the code for the XXX page. To debug this ode, open yw31l.js in Developer Tools. What does this mean? Why does the button not work?
Broad Question:
I'm trying to build a site which provides some tools for people to change their lives.
There will be tools in several categories, for example: 1. how to manage your time
2. how to set goals
3. how to overcome fears
etc.
Under each category, there could be some videos and documents, with a short summary. For example, under the first category of "how to manage your time":
- Video 1 on how to prioritise, with a summary + some thoughts (which is where the expanding and collapsing text comes in)
- Video 2: Talk on managing time, with a summary + some thoughts
- Document 1: link to download a time tracker document, with a summary + some thoughts Similarly under the second category of how to set goals:
- Video 1: talk on different levels of goals, with summary + some thoughts
- Video 2: how to pivot from one goal to another, with summary + some thoughts
etc
each category contains information which is presented in a similar, repetitive format, i.e. (video/picture/document + summary). This will be regularly updated. Any recommendations for how this can be presented? Is a database useful in this instance? Thank you very much!
Thanks Andreas! Here's my code:
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 = 40; // read the full text and store it in the fullText variable fullText = $w("#text21").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("#text21").text = shortText; }); export function button2_click(event, $w) { // display the full text $w("#text21").text = fullText; // collapse the button $w("#text21").collapse(); }
Please add your code, the debug text is always shown in the console.