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

Simon Willison simon at incutio.com
Mon Apr 1 08:29:01 CST 2002

I've been poking around www.iht.com to see how they do their awesomely
impressive DHTML. I've figured out most of it, but I'm having trouble
understanding how the article columns system works. Take a look at this:


The article defaults to 3 columns - you can move to the next "page" to
view the next 3 and move back to the previous one. The multiple "pages"
are an illusion - the article comes as one HTML document and the
different pages are implemented in DHTML. Re-size the window and the
number of "pages" changes - the current view always takes up your exact
browser size (no vertical scroll bar) and you always have three columns
on screen at any one time.

Viewing the source code of the page gives no indication as to how the
article text (which exists all in one big <div>) is dynamically split up
in to columns. I had a look through the javascript but couldn't work out
how it works.

I don't particularly need to know how to do this for anything, but my
curiosity has got the better of me. Anyone know (just roughly) how they
chop a single div up in to columns dynamically like that?



More information about the thelist mailing list