
Originally Posted by
neuzen
problem: zoomed image goes out of browser bounds generating js error
problem code, filename: jscript_imagehover.js
change line: 123 if statement >>
if (docheight - event.clientY < zoomimg_h + (2 * padding)){
ycoord += event.clientY - Math.max(0,(0 + zoomimg_h + (5 * padding) + event.clientY - docheight - truebody().scrollTop));
// ycoord += event.clientY - Math.max(0,(0 + zoomimg_h + (5 * padding) + e.pageY - docheight - truebody().scrollTop));
} else {
// ycoord += truebody().scrollTop + event.clientY;
ycoord += event.clientY - Math.max(0,(0 + zoomimg_h + (5 * padding) + event.clientY - docheight - truebody().scrollTop));
}
Revert back to your old file, and then only apply the change to line 124 (not 126 like the author stated). I couldn't remember the exact line numbers which needed to be changed, thanks to g pointing it out to me above.
So it should read:
Code:
if (docheight - event.clientY < zoomimg_h + (2 * padding)){
ycoord += event.clientY - Math.max(0,(0 + zoomimg_h + (5 * padding) + event.clientY - docheight - truebody().scrollTop));
// ycoord += event.clientY - Math.max(0,(0 + zoomimg_h + (5 * padding) + e.pageY - docheight - truebody().scrollTop));
} else {
ycoord += truebody().scrollTop + event.clientY;
}
Bookmarks