I have an issue with scrolling to the bottom of div.
After I auto scroll to the bottom to the div when page load, the scroll comes back to the top automatically !
<div class="scroll-area-md" id="chatBox">
<div class="scrollbar-container">
<div class="chat-wrapper p-1">
<div class="chat-box-wrapper">
<div>
<div class="avatar-icon-wrapper mr-1">
<div class="avatar-icon avatar-icon-lg rounded">
<img src="'/public/uploads/anyProfile.png?>" alt="">
</div>
</div>
</div>
<div>
<small class="opacity-6">
<i class="fa fa-user-circle-o mr-1"></i>
Username: AAA
</small>
<div class="chat-box">Message space</div>
<small class="float-right">
<span class="opacity-6">
<i class="fa fa-calendar-alt mr-1"></i>
10/10/2020
</span>
</small>
</div>
</div>
</div>
</div>
</div>
<script>
$( document ).ready(function() {
$("#chatBox"). animate({ scrollTop: $(document). height() }, "slow?"); return false;
});
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…