Math Jazz — Mathias Bynens’s shizzle, y’all



Note: This site might seem inactive… That’s because it is. Don’t worry though, I’m still coding webpages and stuff! If you’re interested, I suggest you get a translator and head over to Qiwi; or you could just check the latest site we’ve been working on: Optiek Ockerman Dendermonde. Enjoy! Also be sure to check out MacKeys, a tool to convert MacBook keyboard keys to their single-Unicode-character equivalents. It comes with a QWERTY MacBook keyboard in CSS3, so it’s officially cool.

Fitts’ Law Favelet

The not so off-topic commentary on Indranil’s Hyperlinks Over the Ages inspired me into making this favelet. Shout it out: Paul! I think I’m not the only one who sometimes desperately wants to see how a page would look with a little Fitts’ Law applied to body text links. My preferation goes out to padding: 2px 1px 1px;, which works pretty good for most sites; Herr Mientjes however seems to prefer padding: 4px 0;. Enjoy.

Filed under JavaScript, CSS, Favelets · March 26th, 2005

Comments (8)

Listed below are the responses for this entry.

  1. Rob Mientjes:
    This commenter’s Gravatar

    Hey, I know this shit!

    However…

    Error: uncaught exception: [Exception... "Node cannot be inserted at the specified point in the hierarchy" code: "3" nsresult: "0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)" location: "javascript:(function(){var css;css=document.createElement('link');css.rel='stylesheet';css.type='text/css';css.href='data:text/css,a,a:link{padding:4px 0;}';document.documentElement.childNodes[0].appendChild(css);})(); Line: 1"]

    Maybe it doesn’t work? ;)

    Comment posted on March 26th, 2005 @ 6:56 pm
  2. Rob Mientjes:
    This commenter’s Gravatar

    Oh wait.
    It just won’t work on your site.

    Comment posted on March 26th, 2005 @ 6:57 pm
  3. Indranil:
    This commenter’s Gravatar

    Nice one. Works nicely on my site.

    Comment posted on March 27th, 2005 @ 6:52 am
  4. Mathias:
    This commenter’s Gravatar

    That’s so weird… It works everywhere except on my own site!

    Comment posted on March 28th, 2005 @ 6:57 pm
  5. Vincent Grouls:
    This commenter’s Gravatar

    You get this Javascript exception because your site is using the correct content-type header (i.e. application/xhtml+xml); it works fine on text/html pages though. This probably has something to do with the sort of code you insert.

    I stumbled upon this page when looking for a replacement for writing HTML into a document using the DOM, as .innerHTML doesn’t work. One of the methods I used throws the exact error.

    The error is coming from the appendChild method, but I don’t know the solution unfortunately.

    Comment posted on April 3rd, 2005 @ 6:29 pm
  6. Aankhen:
    This commenter’s Gravatar

    I think it won’t work here because you’re serving your pages up as application/xhtml+xml. You need to check for document.createElementNS and use that if it exists, else use document.createElement.

    Comment posted on April 4th, 2005 @ 9:35 pm
  7. Mathias:
    This commenter’s Gravatar

    Thanks for the info, Vincent and Aankhen. I of course forgot about the document.createElementNS madness, which can be fixed by using the the createElement() function. The favelets are now fixed, and should work in all circumstances.

    Comment posted on April 10th, 2005 @ 9:30 am
  8. mwarden:
    This commenter’s Gravatar

    I don’t think that’s the problem. I haven’t looked at your code, but I assume you are doing something like document.insertBefore(foo, bar). If you instead do bar.parentNode.insertBefore(foo, bar), it should work.

    Comment posted on July 14th, 2005 @ 6:57 pm