jQuery阅读更多 [英] Jquery Read More Toggle

查看:170
本文介绍了jQuery阅读更多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在HTML网站上添加更多"切换按钮,我发现的所有内容只能在一个或两个浏览器中运行,或者不是我想要的.

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.

我只是想在文本下方添加一个阅读更多"的段落,当单击阅读更多"更改为阅读较少",并且div扩展以显示所有文本时.它还需要能够包含多个<p>和一个列表.

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.

如果它具有动画效果以显示平滑的滚动效果,并且在可能的情况下会在阅读更多内容"之前显示一定数量的字符,而不是div高度,那将是很好的选择.

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!

推荐答案

示例可能会有所帮助阅读更多/更少切换.

This example may help you for Read More/Less Toggle.

......

这篇关于jQuery阅读更多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆