Mister Babu Mister Babu - 2 months ago 6x
CSS Question

I am trying to do a Read More button, but I just started using javascript/jquery

I want to do a Read More button, which will expand the page and the text will appear with a nice animation. I tried doing a jquery code but I realised that it was not going to work and I deleted it. The Read More button will appear if the text is bigger than 200 characters. I only have something basic like this.

Javascript code:

$("#clickme").click(function() {


So basically you need to write a login like: 1: Check the string length if you are using PHP then a login could be something like the below:

 <?php $str = "I am in love with PHP";
if(strlen($str) > 10)
  $showten = substr($str, 0, 10);
echo $showten . "<a href="#" class='readmore'>Readmore</a>";

<div class="all-content"><?php echo $str; ?></div>

Now comes the Jquery into action:


This is a sample code, you need to make minor modifcations as per your requirement!!