I have implemented showmore plugin by inserting this line of code:
<script src="script/showmore.js" type="text/javascript"></script>
and adding the 'more' class to:
<span class='each_comment comment more'>
The plugin showmore works easily - you just need to add showmore class to a desired element and thats it. So it has nothing to do with click events! Now when user posts a new comment it appears on AJAX success call:
$('.submit').after('<div class="combine_comment"><div class="user_area_comment"><img class="small_image_user" src="'+url_img+'"/><a href="home.php?u='+username+'"class="username_span">'+username+'</a></div><span class="each_comment comment more">'+comment+'</span> <time class="timeago" datetime="'+data+'">'+data+'</time></div></div>');
As you can see I add 'more' class as well to the span of just added comment. But showmore plugin doesnot work with just added comment. I need to reload the page to see it working though the class is set properly. Do you know what might be wrong and why showmore plugin doesnt 'see' the more class of appended element? Maybe, it has something to do with load DOM? Thanks in advance for your attention and help.