I am going to try more less text for my website. Here is my DEMO from codepen.io
So my website is SocialNetwork like Facebook. Some user was posting a long text I need less more text plugin because of this.
Now my website main page showing last 10 post and when users scroll down then user see show more post button. So if user click show more post then my jQuery more less plugin not working. What should I do for it anyone can help me ?
$(document).ready(function() {
$(".comment").shorten();
$(".comment-small").shorten({showChars: 50});
});
And this is my AJAX code for load more posts:
$('.more').die('click').live("click",function() {
var ID = $(this).attr("id");
var P_ID = $(this).attr("rel");
var URL=$.base_url+'post_more_ajax.php';
var dataString = "lastid="+ ID+"&profile_id="+P_ID;
if(ID) {
$.ajax({
type: "POST",
url: URL,
data: dataString,
cache: false,
beforeSend: function() {
$("#more"+ID).html('<img src="wall_icons/ajaxloader.gif" />');
},
success: function(html) {
$("div#contentpostwallarea").append(html);
$("#more"+ID).remove();
}
});
} else {
$("#more").html('The End');// no results
}
return false;
});