angular.js - angular内容过长展开收起效果
仅有的幸福
仅有的幸福 2017-05-15 17:02:00
0
3
686

1.p中的内容过长,当内容过长,超过两行的显示时,出现一个【展示】标签,展开之后内容最后面出现【收起】标签,类似于QQ空间发表的说说,长了显示全文,完了还可以收起来的效果,我做的无法判断内容长度,而且一行中显示的中英文字数是不等的,想有个效果完整的例子看看。

仅有的幸福
仅有的幸福

reply all(3)
洪涛

Let me give you an idea. In HTML, add an inline-block (your expansion and closing) after the text. The css setting is fixed high, and overflow:hidden is exceeded. js determines the height, and adds a class to the outermost layer after exceeding it. This class controls your expansion and closing, and also clears the fixed height and overflow: hidden. Of course, if it is responsive, you have to think of another way.

我想大声告诉你

angular filter

曾经蜡笔没有小新

Use line-height to specify the height, and use this height to achieve folding and stretching

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!