This commit is contained in:
ahodesuka 2012-01-18 21:01:44 -06:00
parent 3d1de50d15
commit 791c3fcd78

View File

@ -2991,12 +2991,12 @@
} }
}, },
toggle: function(a) { toggle: function(a) {
var thumb, top; var rect, thumb;
thumb = a.firstChild; thumb = a.firstChild;
if (thumb.hidden) { if (thumb.hidden) {
if (thumb.nextSibling.offsetHeight > d.body.clientHeight && (top = a.getBoundingClientRect().top) < 0) { rect = a.getBoundingClientRect();
window.scroll(window.scrollX, window.scrollY + top); d.body.scrollTop += rect.top < 0 ? rect.top + thumb.height / (rect.height / rect.top * -1) : 0;
} d.body.scrollLeft += rect.left < 0 ? rect.left + thumb.width / (rect.width / rect.left * -1) : 0;
return imgExpand.contract(thumb); return imgExpand.contract(thumb);
} else { } else {
return imgExpand.expand(thumb); return imgExpand.expand(thumb);