smooth out jump and clean up CSS a little bit
This commit is contained in:
parent
121de3d9b2
commit
92987ca77b
4 changed files with 23 additions and 18 deletions
|
@ -142,12 +142,19 @@ class InfiniteScroller {
|
|||
}
|
||||
console.log(element, id, ":3");
|
||||
if (element) {
|
||||
element.scrollIntoView();
|
||||
if (flash) {
|
||||
element.scrollIntoView({
|
||||
behavior: "smooth",
|
||||
block: "center"
|
||||
});
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
element.classList.remove("jumped");
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
element.classList.add("jumped");
|
||||
}
|
||||
else {
|
||||
element.scrollIntoView();
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (const thing of this.HTMLElements) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue