<script>
document.addEventListener("DOMContentLoaded", function() {
(function () {
const scrollLink = document.querySelectorAll(".scroll-link");
scrollLink.forEach(function (el, index) {
el.addEventListener('click',function(e) {
const element = document.querySelector('.uc-scroll-end');
let topPosition = element.offsetTop;
if(!element.classList.contains("r")){
const parent = element.closest('.r').offsetTop;
topPosition+=parent;
};
window.scrollTo(0,topPosition);
});
});
})();
});
</script>
<style>
.scroll-link{
cursor: pointer;
}
html {
scroll-behavior: smooth;
}
</style>