There are numerous inquiries regarding this particular issue.
I have exhausted nearly all possible solutions I could find, yet none of them delivered the desired outcome.
This is the structure of my page:
<div>
<header id="status">
// The content within this section changes dynamically
</header>
<div id="summary">
// The height of this div should adjust accordingly and enable vertical scrolling if necessary
</div>
</div>
Currently, I am using the following script to achieve this, but encountering issues when attempting to scroll to the bottom with lengthy text in the header
.
<script>
$(document).ready(function () {
var h = $(window).height();
var headerHt = $("#status").height();
summaryHeight = h - headerHt;
$('#summary').css("height", summaryHeight + 'px'); $('#summary').css({ "overflow-y": "auto", "overflow-x": "hidden" });
$(window).resize(function () {
var h = $(window).height();
var headerHt = $("#status").height();
summaryHeight = h - headerHt;
$('#summary').css("height", summaryHeight + 'px'); $('#summary').css({ "overflow-y": "auto", "overflow-x": "hidden" });
Attempts with 'min-height' and 'max-height' did not yield any positive results.
If anyone can provide assistance, it would be greatly appreciated as I have been struggling with this issue for over a month. Previously, setting a fixed height was effective, but due to the changing header height, that method no longer works.