开发者

jQuery: split and hide html data

开发者 https://www.devze.com 2022-12-24 02:12 出处:网络
I need to split somehow some html data (a text wi开发者_运维知识库th html tags) into two parts and hide the second one with a show/hide link.

I need to split somehow some html data (a text wi开发者_运维知识库th html tags) into two parts and hide the second one with a show/hide link.

The thing is all texts are being stored in the database with html tags. Some of those texts are short, but some are really long. We don't want't to show long ones, so one of the options is to show a teaser with a show/hide link. I can't just cut the string though (let's say first 300 characters), because it'll break html code of the page.

I'm looking for a solution/suggestions how to show a teaser of the text using jQuery without breaking the html code of the page.

Thank you.


have you looked at expader ? looks like that is what your looking for

0

精彩评论

暂无评论...
验证码 换一张
取 消