I would like to know how to do something like Facebook does when you post a large text that shows you something like:
Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Etiam
commodo venenatis nisl id convallis.
Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur
ridiculus mus. Pellentesque habitant
morbi tristique senectus et netus et
malesuada fames ac turpis egestas.
Duis nec odio a libero consequat
pretium … More
So I can output all the text and, with jQuery, select a maximum of words, add the … plus “More” and when I click it expand all the text remaining? All this without AJAX.
I will combine this with PHP for a multilingual site and I need to be able to change easily the word “More” for language support.
Sorry my English is not my main language and explain this is hard to me.
Thank you in advance!
There are many plugins out there to do this, the jQuery Expander plugin is one of the most popular. You can try out a demo here.
Or, there are lighter versions like truncate, you can try it here,