BuzzFeed

I have been working on an idea that gina and nick were discussing at lunch one day. Basically, its a more sophisticated alt text/title popup. It's born out of a frustration with title text in Mozilla that won't wrap lines, and fades too quickly to read any large amount text. I call it alt alt text.

Examples:

  1. Here is a bit of text that I wish to annotate, so I add a span with a question mark at the end of the line that will pop up some more info related to the text ?.

    Notice that the box will fade/close after a bit, but you have the option to stop the box from fading if you wish to keep reading the text.

    Here is the markup used to create the popup:

    <span onmouseover="showAltAlt(this, 'anno', 150);">
    <a href="#" onclick="return false;">?</a>
    </span>.

    <div id="anno" style="visibility: hidden">
    <span>
    This is an example of an annotation using alt alt text </span>
    </div>

    The first span has the javascript onmouseover call.

    showAltAlt(this, 'anno', 150);.

    The first param to the function is a reference to the entity you wish to annotate (mainly for cleanup). The second param is the id of a hidden div with a child span in the current document. This is where the text for the annotation popup is defined, in this case we created a div with the id anno. The third param is the width of the popup, in this case the popup will be 150 pixels wide. So basically, when the the showAltAlt() function is called it references the hidden div with id 'anno' to populate a popup with anno's markup.

  2. This next example is one that annotates an image when you roll over it. In this instance the popup will not fade by default.

    The only major difference in this example from the first is an extra parameter passed to the showAltAlt() function. To keep the popup from closing we pass a fourth param of true.

    <img src="/images/lemon.gif" width="25" height="20" onmouseover="showAltAlt(this, 'lemon', 200, true);">

    showAltAlt(this, 'lemon', 200, true);

I have provided the source for anyone bold enough to crash their browser with my javascript: altalt.txt

any feedback is most appreciated.

tags: javascript,  software
alt alt text October 30, 2004
comments (4)
Comments

What a nice touch! I think a better name for it would be LiveFootnote or ActiveFootnote maybe? It's more than just alttext.

Now I have but one question for you: does it work cross-browser, or only in certain browsers?

Keep up the great work, Mark. And remember your absentee ballot must be postmarked by no later than today to be considered valid.

posted October 30, 2004 11:12 AM by Nick Bauman

Very cool!! I've been working on an app that will allow you to annotate a web page.... it's not going so well. I was using overlib:
http://www.bosrup.com/web/overlib/

posted October 30, 2004 11:49 AM by Gina

Better usability:

The yellow box faded away, before I could read the instruction on the bottom of the box to prevent the dissapearing.

Maybe it can be visible as long as the mouse is over it.

posted October 31, 2004 8:22 AM by Jano

Nice idea. I'll have to check out how it looks on my Mac at home. I would agree with the previous commenter that leaving the note open as long as the mouse is over the link might be a good idea. Or having the timer for the fade-away start when the mouse first exits the link. Nice work nevertheless.

posted November 1, 2004 7:49 AM by ramanan

Comments are temporarily closed...