cdmScrollToArticleId: use more natural scrolling
This commit is contained in:
parent
cb0810962c
commit
3af9dbd350
1 changed files with 5 additions and 1 deletions
|
@ -1132,7 +1132,11 @@ function cdmScrollToArticleId(id) {
|
||||||
|
|
||||||
if (!e || !ctr) return;
|
if (!e || !ctr) return;
|
||||||
|
|
||||||
ctr.scrollTop = e.offsetTop;
|
if (e.offsetTop+e.offsetHeight > (ctr.scrollTop+ctr.offsetHeight) ||
|
||||||
|
e.offsetTop < ctr.scrollTop) {
|
||||||
|
|
||||||
|
ctr.scrollTop = e.offsetTop;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("cdmScrollToArticleId", e);
|
exception_error("cdmScrollToArticleId", e);
|
||||||
|
|
Loading…
Reference in a new issue