<div class="rest button content" id="rest button content" style="display: none;"><div id="rest button" onclick="rest_butt();" style="margin: 1rem auto; line height: 2.3rem; display: block; width: 8rem; border radius: 5px; border: 1px solid # 6f8ec5; text align: center; cursor: pointer; color: # 6f8ec5;">Read the rest</div></div> <script> if($('.art-content').height()>600){ //If the content page height is greater than 600 $('.art-content').height('600'); $('#rest-butt-content').show(); //Control the height of the content page to 600 //And the button is in display status }else{ //Otherwise, the Read More button will not appear $('#rest-butt-content').hide(); } function rest_butt(){ $('.art-content').height('100%'); $("#rest-butt-content").remove(); } </script>