Dear DP members, I am looking for small work for my website. I want Read More option to Expand the hidden text. Example Images - After Clicking Read More -
HTML: <div class="wrap"> <p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. </p> <a class="readmorebtn">Read more</a> <p class="more">Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Curabitur blandit tempus porttitor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas faucibus mollis interdum. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur. </p> </div> Code (markup): jQuery: var moreText = "Read more", lessText = "Read less", moreButton = $("a.readmorebtn"); moreButton.click(function () { var $this = $(this); $this.text($this.text() == moreText ? lessText : moreText).next("p.more").slideToggle("fast"); }); Code (markup):
Save the jquery code in a file and put something like this in between the head tags <script type="text/javascript"src="/path_to_js_files/jquery.js"></script>
Are you using a content management system like WordPress? If not then follow his instructions. If you want me to do it for you I'll do it quick for $5 PayPal.
This is the best way to go IMHO. It's written by @deathshadow for a DP member. http://www.cutcodedown.com/for_others/borduhh/template.html Unlike jQuery garbage, it's degrading gracefully. Proper, semantic markup is used as well.
I did that, the script is working but when i use it in CS - Cart it doesn't work. Anyone can do this for me? Can pay $5 - $10