The pages that I frequent are now talking about pop up windows, the coincedence is that I have been working on a unobtrusive solution myself. I took some stuff written by better javascripters than me (Martin, Jeremy Keith and Peter-Paul Koch among others) and together with a co-worker, Tino Loos, decided to add some things.

But first of, let me say, this is not a post about wether you should use popup’s. My opinion is, that it should be avoided, but If you have to, do it correct. That is, using unobtrusive javascript and so on.

That being said, let’s continue…

The stuff I thought were missing were, mostly, flexibility. So I went and added just that. In my script you not only can call a popup window, just by using a class “popup”. You can also define its width and height, by adding the classes “w:800 h:500”.

Nice one, isn’t it…

Here are some examples, a link without width or height set and one with the width and height set.

In my next post I will explain what I (we) have done, in the meantime, go and check the code, to see for your self…

Next post The javascript for the pop up window.

The one thereafter How to get part of a className, namespaces anyone :)

Maybe before that, a happy clog meeting report