I have this method in each element that I select, but it does not scroll up, what can it be?
function() {
console.warn("<br>Elemento del tipo: <b>" + document.activeElement.type + "</b>");
var elemento = document.activeElement;
var posleft = elemento.offsetLeft;
var postop = elemento.offsetTop;
console.warn("Left: " + posleft + "px - Top: " + postop + "px");
//$('html, body').scrollTop(postop-300);
$('html, body').animate({scrollTop: 0 - 300}, 250);
}