Read More Feature with JQuery slideToggle Method

六眼飞鱼酱① 提交于 2019-12-11 07:45:53

问题


Everyone, I am trying to do read more feature with JQuery's slideToggle thing but the problem is as read more feature normally there is a little text shown on the page and when the user clicks on read more link,button etc. the panel slides downwards and shows the rest of the text but with slideToggle I can't see any start point or something to show first couple of lines before sliding panel. The data is retrieved from database so it's dynamic.

I hope I can describe the problem :( so could some one show me a way to do it with jquery.

Thanks in advance...


回答1:


Actually I've found something better :)

jQuery Expander Plugin

http://plugins.learningjquery.com/expander/index.html#getting-started




回答2:


You're need to separate the preview content from the readmore content. This can be done either manually if you have a static html page, or dynamically during page generation if you are using a server side scripting language (.net, php, etc). Basically the preview content needs to be outside of which ever element (probably a DIV) the slideToggle function is being used on.



来源:https://stackoverflow.com/questions/1249804/read-more-feature-with-jquery-slidetoggle-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!