markpasc (markpasc) wrote,

IHT's flowing columns

The International Herald Tribune Online, imo a great online newspaper, has a cool columnized article interface. The strange part is its columns flow so well: you can change the text size and the columns still flow. Anyone who's messed with HTML 4 and CSS enough to know that's impossible knows that's impossible. It's taken me a bit of fawning and poring, but I figured it out.

Looking at its Javascript, you can see that it does its flowing columns by having each column contain the entire article. It then remembers how far down a theoretical single column you are in the article, and messes with the column blocks' positioning accordingly, so it only shows the appropriate section of the article.

You can see easy proof (of sorts) in Mozilla: do a Select All and a Copy, and Paste into your text editor of choice. There will be four copies of the full article text: the original hidden copy and the three columns' cloned texts.

It's quite a neat system, but it'll be nice when you can specify in CSS the block into which to overflow and let the browser handle it.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened