JSFiddle - React, Tailwind, and code Playground
by letanure
HTML
<div id="divGrande">
<button id="topoEsquerda">ir para rodape direita</button>
<button id="rodapedireita">ir para topo esquerda</button>
</div>
CSS
#divGrande{
width:1000px;
height:1000px;
position:relative;
border:2px solid red;
margin:50px;
}
#topoEsquerda{
position:absolute;
top:0;
left:0;
}
#rodapedireita{
position:absolute;
bottom:0;
right:0;
}
JavaScript
$('#topoEsquerda').click(function(){
$('html, body').animate({
scrollTop: $("#rodapedireita").offset().top,
scrollLeft: $("#rodapedireita").offset().left
});
});
$('#rodapedireita').click(function(){
$('html, body').animate({
scrollTop: 0,
scrollLeft: 0
});
});