Expand text

Highlighted
New Member
4 0 0

I am trying to create an action to expand/collapse (read more, show/hide) text where I display a line, and the visitor clicks (or at least hovers over) it, and it then expands to a paragraph of text.    So I only want to show a little text so it doesn't take up a lot of space, and if the customer wants to see more, they can expand it.  Most of the questions here on this topic seem to have to do with images or collections, not just simple text. I have tried to modify those suggestions for my needs but can't get it to work.  Any suggestions would be really appreciated.  Thanks!

 

0 Likes
Highlighted
New Member
4 0 0

Just following up to see if anyone has an idea how to do this.  Thanks.

0 Likes
Highlighted

Yes, both solution are feasible by adding some custom JavaScript/CSS to your theme code.

You can create an text element or button that if clicked expand a section normally hidden.
This type of solution is usually named Accordion and you can decide to code by yourself from scratch or include a JavaScript library.

Or you can show a part of the paragraph and have a Read More text that, if clicked, shows the rest of the paragram.
Also in this case you can code, or use a JS library, like for example Readmore.js

 

• If the problem is solved remember to click ✅ to Accept Solution
• Press Like, if the answer was helpful
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
0 Likes
Highlighted
New Member
4 0 0

Thank you.  Accordion kept coming up in my research and I tried adding the code to my theme files but it didn't work.  I am using the debut theme.  Are there any more suggestions, perhaps more detailed about how to do it?  I would really appreciate it!  Thanks!  

0 Likes