Javascript scrollIntoView only in immediate parent

I think what you might be looking for is

.scrollIntoView({block: "nearest", inline: "nearest"});

Where supported (basically anywhere except IE and SafarIE) this will do the ‘least’ movement to show the element; so if the outer container is visible, but the target element is hidden inside that container — then it should scroll the inner container but not the page.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)