[thelist] How do they do that then? (IHT.com)

Ben Henick persist1 at io.com
Tue Apr 2 03:50:01 CST 2002

On Tue, 2 Apr 2002, Simon Willison wrote:

> I've got it pretty much figured out now, it's a very clever system. The
> one last detail that's bugging me is the splitting in to paragraphs bit
> - I've been through pretty much every bit of javascript on there (I even
> ran a search for "split" in the files) but I can't see how he splits up
> the pages. I'm guessing that the splitting is the reason he has this
> code interspersed through his articles:
> <div style="visibility:hidden">.</div>
> But I can't spot the code that splits stuff up based on that (or figure
> out how he does the split in the first place).

Well, when he and I originally discussed it, he mentioned that the code at
times "steps back" according to the size of the canvas.

After puzzling over it, I finally see how it works.

He creates copies of the article body, and then "windows" them as needed.
Because of the way the CSS is written, he just scrolls the DIV's as

Egad, no wonder he told me that he was going to take a break from
JavaScript for a while.

I personally would use String.split().

The visiblity="hidden" references are there as a CSS hack that creates
whitespace between paragraphs in the body copy.

Ben Henick
Web Author At-Large              Managing Editor
http://www.io.com/persist1/      http://www.digital-web.com/
persist1 at io.com                  bmh at digital-web.com
"Are you pondering what I'm pondering, Pinky?"
"I think so, Brain, but... (snort) no, no, it's too stupid."
"We will disguise ourselves as a cow."
"Oh!" (giggles) "That was it exactly!"

More information about the thelist mailing list