1
I made some attempts, but I was unsuccessful... The priority is that it be in pure Javascript... But since I could not, I tried with jQuery also.
The situation would be, each time the user increases or decreases the amount of input, the page updates and the Scroll should maintain its last position. In my case he’s going to the top.
Some of my attempts were:
//1)
var posicaoScroll = $(document).scrollTop();
$(document).scrollTop(posicaoScroll);
//2) "cart-table__product" é a classe a minha lista de produtos no carrinho
$(document).ready(function() {
$('.cart-table__product').attr({scrollTop: $('.cart-table__product').attr('scrollHeight')});
});
//3)
function scroll() {
var objScrDiv = document.getElementsByClassName("cart-table__product");
objScrDiv.scrollTop = objScrDiv.scrollHeight;
}
Thanks @Dobrychtop worked!
– R.Park