Below is my script working fine for show more and show less. But please tell me how to show first three rows after that. I want to show the show more button.
The data is coming from foreach
loop and in tabular format.
After x = 4, please tell me what to add so that it displays 3 rows of foreach. After that I want same script to work:
<script>
$(document).ready(function () {
x = 4;
size_li = $("#Table td").size();
//$('#Table tr').show(x);
$('#td td:lt('+x+')').show();
$('#loadMore').click(function () {
x= (x+5 <= size_li) ? x+4 : size_li;
$('#Table td:lt('+x+')').show();
});
$('#showLess').click(function () {
x=(x-5<0) ? 5 : x-4;
$('#Table td').not(':lt('+x+')').hide();
});
});
</script>