Simple jquery "Read More" code to mange huge size of content
Snippet Code
Rate this page :
[ 0 votes]
Here you can see the simple jquery code to display the hidden content of your website.
<script type='text/javascript'>
$(document).ready(function () {
$(".morecontent").hide();
$(".hidecontent").hide();
$(".readcontent").click(function () {
var txt = $(".morecontent").is(':visible') ? 'Read More' : 'Read Less';
$(".readcontent").hide();
$(".hidecontent").show();
$(this).next('.morecontent').slideToggle(200);
});
$(".hidecontent").click(function () {
var txt = $(".morecontent").is(':visible') ? 'Read More' : 'Read Less';
$(".readcontent").show();
$(".hidecontent").hide();
$(this).prev('.morecontent').slideToggle(200);
});
});
</script>
We welcome you to Hscripts.com. Praised as the best free webmaster resources online,
by our users.
<a href='#' class="readcontent">Read More</a>
<p class="morecontent">If you are designing a website, then you can
find all the resources you need to webmasters and web developers such as free scripts,
web tools, programming tutorials,web design and applications, clipart images, web icons etc.</p>
<a href='#' class="hidecontent">Read Less</a>