Scroll to top of thumbnail when contracting expanded image
This commit is contained in:
parent
8f29d8eac9
commit
efc557cb1d
@ -2995,12 +2995,8 @@
|
|||||||
thumb = a.firstChild;
|
thumb = a.firstChild;
|
||||||
if (thumb.hidden) {
|
if (thumb.hidden) {
|
||||||
rect = a.getBoundingClientRect();
|
rect = a.getBoundingClientRect();
|
||||||
if (rect.top < 0) {
|
if (rect.top < 0) d.body.scrollTop += rect.top;
|
||||||
d.body.scrollTop += rect.top + thumb.height / (rect.height / rect.top * -1);
|
if (rect.left < 0) d.body.scrollLeft += rect.left;
|
||||||
}
|
|
||||||
if (rect.left < 0) {
|
|
||||||
d.body.scrollLeft += rect.left + thumb.width / (rect.width / rect.left * -1);
|
|
||||||
}
|
|
||||||
return imgExpand.contract(thumb);
|
return imgExpand.contract(thumb);
|
||||||
} else {
|
} else {
|
||||||
return imgExpand.expand(thumb);
|
return imgExpand.expand(thumb);
|
||||||
|
|||||||
@ -2317,8 +2317,8 @@ imgExpand =
|
|||||||
thumb = a.firstChild
|
thumb = a.firstChild
|
||||||
if thumb.hidden
|
if thumb.hidden
|
||||||
rect = a.getBoundingClientRect()
|
rect = a.getBoundingClientRect()
|
||||||
d.body.scrollTop += rect.top + thumb.height / (rect.height / rect.top * -1) if rect.top < 0
|
d.body.scrollTop += rect.top if rect.top < 0
|
||||||
d.body.scrollLeft += rect.left + thumb.width / (rect.width / rect.left * -1) if rect.left < 0
|
d.body.scrollLeft += rect.left if rect.left < 0
|
||||||
imgExpand.contract thumb
|
imgExpand.contract thumb
|
||||||
else
|
else
|
||||||
imgExpand.expand thumb
|
imgExpand.expand thumb
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user