Archives

The following is a technique to produce external window links that are more accessible, future-proof, standards compliant and degrade elegantly by using the 'REL' attribute. The technique is explained in detail in the March edition of the SitePoint Design View.

Example

  
  Pop Goes the Weasel
  
    Half a pound of tuppenny rice,
    Half a pound of treacle.
    That’s the way the money goes,
    Pop goes the weasel.

    Up and down the City road,
    In and out  the Eagle,
    That’s the way the money goes,
    Pop goes the weasel.

The XHTML

The markup for the new window is ultra simple and seems future-proof to me. As you might have guessed, popup window dimensions can be set by changing the values within the REL ('popup|height|width').

The JavaScript

The CSS

CSS classes are appended to each link to allow us to style them differently to standard links. Feel free to customize their look and feel, but keep in mind that they are designed to sit inline with the content, so they'll work best if you take a minimialist approach. They really shouldn't have any more 'visual weight' than a capital letter of the paragraph they inhabit.