Use getBoundingClientRect and body.clientHeight for offset fix
This commit is contained in:
parent
7a2343f6c5
commit
9baddbc771
@ -2991,16 +2991,11 @@
|
||||
}
|
||||
},
|
||||
toggle: function(a) {
|
||||
var el, thumb, top;
|
||||
var thumb, top;
|
||||
thumb = a.firstChild;
|
||||
if (thumb.hidden) {
|
||||
if (thumb.nextSibling.offsetHeight > window.innerHeight) {
|
||||
el = thumb.nextSibling;
|
||||
top = el.offsetTop;
|
||||
while (el = el.offsetParent) {
|
||||
top += el.offsetTop;
|
||||
}
|
||||
if (top < window.scrollY) window.scroll(window.scrollX, top);
|
||||
if (thumb.nextSibling.offsetHeight > d.body.clientHeight && (top = a.getBoundingClientRect().top) < 0) {
|
||||
window.scroll(window.scrollX, window.scrollY + top);
|
||||
}
|
||||
return imgExpand.contract(thumb);
|
||||
} else {
|
||||
|
||||
@ -2316,12 +2316,8 @@ imgExpand =
|
||||
toggle: (a) ->
|
||||
thumb = a.firstChild
|
||||
if thumb.hidden
|
||||
if thumb.nextSibling.offsetHeight > window.innerHeight
|
||||
el = thumb.nextSibling
|
||||
top = el.offsetTop
|
||||
while el = el.offsetParent
|
||||
top += el.offsetTop
|
||||
window.scroll window.scrollX, top if top < window.scrollY
|
||||
if thumb.nextSibling.offsetHeight > d.body.clientHeight and (top = a.getBoundingClientRect().top) < 0
|
||||
window.scroll window.scrollX, window.scrollY + top
|
||||
imgExpand.contract thumb
|
||||
else
|
||||
imgExpand.expand thumb
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user