On Sat, Aug 14, 2010 at 8:00 PM, <thomasV1(a)gmx.de> wrote:
nice demo ; it would be nice to make it more
efficient.
I see that you are generating images with a size that is adapted to the user's
screen. If you do this, hundreds of thumbnails of all possible sizes will be generated at
commons for each page. To avoid this, you should quantize the size : use a width that is a
multiple of 100 pixels, as ProofreadPage does (Tim asked me to do this). In addition, if
you use this restricted set of widths, then thumbnails will be more likely to already
exist and will load faster.
To gain some speed, you could also preload pages p+1 and p-1, as google books does.
Both good ideas, I'll do that.
Also, in on_body_scroll, you could avoid the for loop
: divide $('#body').position()['scrollTop'] by the height of an image
'fraid not - sometimes the rendered text runs longer than the image,
so the "row" can be higher than the image. Example:
http://toolserver.org/~magnus/book2scroll/index.html
(scroll down and you'll see it)
Cheers,
Magnus