Unwanted space between short text and Show More button

Hi there,

I followed the steps in the tutorial linked below to create several text boxes where you can toggle how much text is visible on website load vs after clicking the ‘Show More’ button. Worked like a charm except I’ve got one text box where on website load, there’s a huge space between the ‘short text’ and the actual button - enough space to fit the rest of the text that just isn’t showing. Can’t figure out how to remove it and it’s not happening for any of the other text boxes. Thoughts? Thanks!

https://support.wix.com/en/article/corvid-tutorial-creating-a-show-more-link

The text that you put in the textbox via the editor should be the short version (or any text shorter).
Then you can assign the short/full text using code. But if you put the full text in the textbox from the beginning you’ll have this issue.

  • They should correct their tutorial to prevent this problem.
    meaning, instead of this line:
 fullText = $w("#myTextElement").text; 

You should write:

fullText = "put your full text here"

Hmm that doesn’t seem right - I’ve included the long text in every single other text box without this issue…

You’re not the first nor the second to have troubles with this particular issue (just yesterday someone here asked the very same question). Putting the short text (or even just one character) in the text-box solves the issue.

I hear you, I’m sure it fixes the issue, it’s just totally illogical that this would only be a problem in one text box out of 10+ that I’ve created. It’s why I assume there’s got to be a more robust fix.

I’m happy to try your fix but how on earth do I keep my formatting? I don’t have text formatting (gave up on that because it requires HTML and I don’t have the time nor the patience to figure that out) but I do have blank lines separating some of the text to make it more legible. How do I keep that?

Figured it out. In case anyone else needs it, just add \n before any text that you want to start on a new line (and it would be \n \n for cases where you want a fully blank line in between text, i.e. a new paragraph).