Hey guys, so i have a comment section.
And what i want to do is if the height of the comment box is larger then lets say 100px.
I want to set the height of the comment box to 50px and then display a "read more" button.
And this read more button would toggle and allow the height to be "auto" and not set to 50px.
so my html would look like this
Code:
<div class="comment-section">
<div class="comment"><p>This is where text would go. </p></div>
<div class="read-more">Read More</div>
</div>
I have the class "read-more" set to "display:none"
How would i do this?
This is what i have / was trying and have been unsuccessful
Code:
<script type="text/javascript">
$(function(if ($".comment".style.height > 100px;){
{
$".comment".style.height = 50px;
$".read-more".style.display = block;
}
});
</script>