Ben Langhinrichs

Photograph of Ben Langhinrichs

E-mail address - Ben Langhinrichs






March, 2007
SMTWTFS
    01 02 03
04 05 06 07 08 09 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Search the weblog





























Genii Weblog


Civility in critiquing the ideas of others is no vice. Rudeness in defending your own ideas is no virtue.


Sun 25 Mar 2007, 09:11 PM
In customizing the latest version of FCKeditor for our upcoming CoexEdit release, I noticed this technique for showing toolbar icons.  It is one with which I am not familiar.  Basically, instead of each toolbar icon being a separate image, there is one long image (see a portion of it to the left).  Each image is 16x16 pixels, and they are simply stacked vertically, all 68 of them.  Then, the images are displayed using a bit of JavaScript code such as:

eCell.innerHTML = '<div class="TB_Button_Image"><img src="default/fck_strip.gif" style="top:-' + ( i * 16 ) + 'px;"><\/div>' ;

referencing the CSS which looks like:

.TB_Button_Image
    {
    overflow: hidden;
    width: 16px;
    height: 16px;
    margin: 3px;
    background-repeat: no-repeat;
    }

So, while I understand how it works, I am a bit mystified as to the purpose.  The images were small to start with, and the very minor byte size reduction was more than overwhelmed by the additional JavaScript, so it wasn't a clever attempt to reduce delayed images, as I first thought.  So, why?  Anybody know?

Copyright © 2007 Genii Software Ltd.