0

I have created a views with trimmed fields and displaying more button to show the full content.I want to do something like collapse text ie.,when i click on more button it has to expand and show the full text.Any help will be much appreciated on how to do this.Thanks in advance.

3

This will require some custom theming to accomplish:

  1. In your view, don't trim the field, just show it all for now. This will mean if a user has JavaScript disabled they will still have access the all the content.
  2. In order to enhance the interface as you've described for users with JavaScript enabled, you should take a look at this tutorial.
  3. You will have to tweak things to get it working with your theme. If you're unsure about adding Javascript to a theme, check this out.
2

You could use CSS :active.

Something like this:

Styles:

.more-link p {display: none;}
.more-link:active p {display: block;}

HTML:

<a href="#" class="more-link">
<p>Hidden text</p>
</a>

It is possible to use CSS transition to show text block smoothly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.