问题
Im looking to add a 'read more' toggle button to a HTML website, everything i've found either only works in one or two browsers or isnt quite what im looking for.
I simply want to have a paragraph of text with 'read more' underneith, when clicked the 'read more' changes to 'read less' and the div expands to show all of the text. It also need to be able to contain more than one <p>
and a list.
Would be great if it was animated to show a smooth scroll and if possible would show a certain amount of characters before the 'read more' rather than a div height.
Can anyone help? Thanks in advance!
回答1:
You can use READMORE.JS, responsive jQuery plugin for collapsing and expanding long blocks of text with "Read more" and "Close" links
回答2:
This example may help you for Read More/Less Toggle.
......
来源:https://stackoverflow.com/questions/34926435/jquery-read-more-toggle