I finally decided to use this solution (jQuery):
var $w = $(window); var right_edge_x = $w.scrollLeft() + $w.width(); var bottom_edge_y = $w.scrollTop() + $w.height();
I'm not sure exactly how it differs from the other solutions proposed, not to mention whether it is better, but at least I can understand it ...
source share