mirror of
https://github.com/typecho/typecho.git
synced 2025-03-23 19:40:22 +01:00
修正自动滚动
This commit is contained in:
parent
26983314b0
commit
48491a7387
@ -140,9 +140,10 @@ $(document).ready(function () {
|
||||
var diff = $('.diff', preview);
|
||||
|
||||
if (diff.length > 0) {
|
||||
var p = diff.position();
|
||||
var p = diff.position(), lh = diff.parent().css('line-height');
|
||||
lh = !!lh ? parseInt(lh) : 0;
|
||||
|
||||
if (p.top < 0 || p.top > preview.height()) {
|
||||
if (p.top < 0 || p.top > preview.height() - lh) {
|
||||
preview.scrollTo(diff, {
|
||||
offset : - 50
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user